From 770372ad029f211dbd0d7e9f3d4ffd59737b8660 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 30 May 2020 12:40:12 +0200 Subject: [PATCH] LibWeb: Handle end-of-file token during "in body" insertion mode --- Libraries/LibWeb/Parser/HTMLDocumentParser.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index cc2ad6301e..bf76961d53 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -801,7 +801,17 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token) } if (token.is_end_of_file()) { - TODO(); + // FIXME: If the stack of template insertion modes is not empty, + // then process the token using the rules for the "in template" insertion mode. + + // FIXME: If there is a node in the stack of open elements that is not either + // a dd element, a dt element, an li element, an optgroup element, an option element, + // a p element, an rb element, an rp element, an rt element, an rtc element, + // a tbody element, a td element, a tfoot element, a th element, a thead element, + // a tr element, the body element, or the html element, then this is a parse error. + + stop_parsing(); + return; } if (token.is_end_tag() && token.tag_name() == "body") {