mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Fix incomplete assertion in the "in body" parsing state
We were incorrectly tripping an assertion failure on some WPT tests.
This commit is contained in:
parent
40ac3cc2c8
commit
ecc9fdf377
Notes:
github-actions[bot]
2024-11-03 16:52:50 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/ecc9fdf3771 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2130
1 changed files with 3 additions and 2 deletions
|
@ -1778,10 +1778,11 @@ void HTMLParser::handle_in_body(HTMLToken& token)
|
||||||
// Parse error.
|
// Parse error.
|
||||||
log_parse_error();
|
log_parse_error();
|
||||||
|
|
||||||
// If the stack of open elements has only one node on it, or if the second element on the stack of open elements is not a body element, then ignore the token. (fragment case)
|
// If the stack of open elements has only one node on it, or if the second element on the stack of open elements is not a body element, then ignore the token.
|
||||||
|
// (fragment case or there is a template element on the stack)
|
||||||
if (m_stack_of_open_elements.elements().size() == 1
|
if (m_stack_of_open_elements.elements().size() == 1
|
||||||
|| m_stack_of_open_elements.elements().at(1)->local_name() != HTML::TagNames::body) {
|
|| m_stack_of_open_elements.elements().at(1)->local_name() != HTML::TagNames::body) {
|
||||||
VERIFY(m_parsing_fragment);
|
VERIFY(m_parsing_fragment || m_stack_of_open_elements.contains(HTML::TagNames::template_));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue