mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibWeb: Set doctype node immediately while parsing XML document
Instead of deferring it to the end of parsing, where scripts that were expecting to look at the doctype may have already run.
This commit is contained in:
committed by
Andreas Kling
parent
ab0dc83d28
commit
cd446e5e9c
@@ -182,9 +182,6 @@ ErrorOr<void, ParseError> Parser::parse_with_listener(Listener& listener)
|
||||
if (result.is_error())
|
||||
m_listener->error(result.error());
|
||||
m_listener->document_end();
|
||||
if (m_doctype.has_value()) {
|
||||
m_listener->set_doctype(m_doctype.release_value());
|
||||
}
|
||||
m_root_node.clear();
|
||||
return result;
|
||||
}
|
||||
@@ -621,7 +618,8 @@ ErrorOr<void, ParseError> Parser::parse_doctype_decl()
|
||||
TRY(expect(">"sv));
|
||||
|
||||
rollback.disarm();
|
||||
m_doctype = move(doctype);
|
||||
if (m_listener)
|
||||
m_listener->doctype(doctype);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user