mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Don't delay document "load" event for unclosed script tags
We previously had a bug where markup with unclosed script tags caused the document load event to be delayed indefinitely. Fix this by only marking script elements as delaying the load event once we encounter the script end tag.
This commit is contained in:
@@ -2093,6 +2093,11 @@ void HTMLParser::handle_text(HTMLToken& token)
|
||||
flush_character_insertions();
|
||||
|
||||
NonnullRefPtr<HTMLScriptElement> script = verify_cast<HTMLScriptElement>(current_node());
|
||||
|
||||
// The document's "load" event is delayed until every script becomes ready.
|
||||
// See HTMLScriptElement internals for how readiness is determined.
|
||||
script->begin_delaying_document_load_event({}, *m_document);
|
||||
|
||||
(void)m_stack_of_open_elements.pop();
|
||||
m_insertion_mode = m_original_insertion_mode;
|
||||
// Let the old insertion point have the same value as the current insertion point.
|
||||
|
||||
Reference in New Issue
Block a user