mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +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:
parent
462618b68c
commit
2c9dfadb21
Notes:
sideshowbarker
2024-07-17 17:07:15 +09:00
Author: https://github.com/awesomekling
Commit: 2c9dfadb21
3 changed files with 10 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue