From 22521e57fdd70f578a813d5a7210195015e52918 Mon Sep 17 00:00:00 2001 From: Kyle McLean Date: Wed, 3 Jun 2020 23:03:19 -0600 Subject: [PATCH] LibWeb: Handle "form" end tag during "in body" if stack of open elements does not contain "template" --- Libraries/LibWeb/Parser/HTMLDocumentParser.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp index 60d290f08f..39701f567f 100644 --- a/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp +++ b/Libraries/LibWeb/Parser/HTMLDocumentParser.cpp @@ -1061,7 +1061,15 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token) } m_stack_of_open_elements.elements().remove_first_matching([&](auto& entry) { return entry.ptr() == node.ptr(); }); } else { - TODO(); + if (!m_stack_of_open_elements.has_in_scope("form")) { + PARSE_ERROR(); + return; + } + generate_implied_end_tags(); + if (current_node().tag_name() != "form") { + PARSE_ERROR(); + } + m_stack_of_open_elements.pop_until_an_element_with_tag_name_has_been_popped("form"); } return; }