LibWeb: Parse barebones document without doctype, <html>, etc.

Last night I tried making a little test page that had a bunch of <img>
elements and nothing else. It didn't work.

Fix this by correctly adding a synthesized <html> element to the
document if we get something else in the "before html insertion mode.
This commit is contained in:
Andreas Kling 2020-06-02 08:47:20 +02:00
parent d5ae73a63b
commit 410fa5abe0
Notes: sideshowbarker 2024-07-19 05:54:01 +09:00

View File

@ -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;