mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 02:08:53 +00:00
LibWeb: Indicate documents are for fragment parsing during construction
This will allow testing if they are for fragment parsing during methods invoked from Document::initialize.
This commit is contained in:
parent
2cc2646f55
commit
c838ca78c8
Notes:
github-actions[bot]
2024-08-01 09:36:56 +00:00
Author: https://github.com/trflynn89
Commit: c838ca78c8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/916
3 changed files with 18 additions and 9 deletions
|
@ -4269,11 +4269,9 @@ DOM::Document& HTMLParser::document()
|
|||
Vector<JS::Handle<DOM::Node>> HTMLParser::parse_html_fragment(DOM::Element& context_element, StringView markup, AllowDeclarativeShadowRoots allow_declarative_shadow_roots)
|
||||
{
|
||||
// 1. Create a new Document node, and mark it as being an HTML document.
|
||||
auto temp_document = DOM::Document::create(context_element.realm());
|
||||
auto temp_document = DOM::Document::create_for_fragment_parsing(context_element.realm());
|
||||
temp_document->set_document_type(DOM::Document::Type::HTML);
|
||||
|
||||
temp_document->set_is_temporary_document_for_fragment_parsing({});
|
||||
|
||||
// 2. If the node document of the context element is in quirks mode, then let the Document be in quirks mode.
|
||||
// Otherwise, the node document of the context element is in limited-quirks mode, then let the Document be in limited-quirks mode.
|
||||
// Otherwise, leave the Document in no-quirks mode.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue