LibWeb: Parse "body" end tags during "in body"

This commit is contained in:
Kyle McLean 2020-06-03 22:36:08 -06:00 committed by Andreas Kling
parent 1ad81e4833
commit 5e3972a946
Notes: sideshowbarker 2024-07-19 05:51:12 +09:00

View file

@ -889,15 +889,16 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
if (token.is_end_tag() && token.tag_name() == "body") {
if (!m_stack_of_open_elements.has_in_scope("body")) {
TODO();
PARSE_ERROR();
return;
}
// FIXME: Otherwise, 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.
for (auto& node : m_stack_of_open_elements.elements()) {
if (!node.tag_name().is_one_of("dd", "dt", "li", "optgroup", "option", "p", "rb", "rp", "rt", "rtc", "tbody", "td", "tfoot", "th", "thead", "tr", "body", "html")) {
PARSE_ERROR();
break;
}
}
m_insertion_mode = InsertionMode::AfterBody;
return;