From 410fa5abe0f85b24b9df7c96918672a243d9624a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 2 Jun 2020 08:47:20 +0200 Subject: [PATCH] LibWeb: Parse barebones document without doctype, , etc. Last night I tried making a little test page that had a bunch of elements and nothing else. It didn't work. Fix this by correctly adding a synthesized element to the document if we get something else in the "before html insertion mode. --- Libraries/LibWeb/Parser/HTMLDocumentParser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index 4acbbaa2b7..c71cc8ded1 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -214,6 +214,7 @@ void HTMLDocumentParser::handle_before_html(HTMLToken& token) AnythingElse: auto element = create_element(document(), "html"); + document().append_child(element); m_stack_of_open_elements.push(element); // FIXME: If the Document is being loaded as part of navigation of a browsing context, then: run the application cache selection algorithm with no manifest, passing it the Document object. m_insertion_mode = InsertionMode::BeforeHead;