mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 09:04: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:
committed by
Andreas Kling
parent
2cc2646f55
commit
c838ca78c8
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user