diff options
author | Andreas Kling <kling@serenityos.org> | 2022-03-19 16:11:36 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-19 16:11:36 +0100 |
commit | cbd343dcedfb061bc5c3c01c3caae78010cee219 (patch) | |
tree | 27fd884afd8df3193f62bdbbc358213d97ad448b /Userland/Libraries/LibWeb/HTML/Parser | |
parent | c1f0d21bbefadaf2e8c9b295c74132c550d43e07 (diff) | |
download | serenity-cbd343dcedfb061bc5c3c01c3caae78010cee219.zip |
LibWeb: Only delay "load" event for script elements that load something
We shouldn't delay the load event for scripts that we're completely
refusing to run anyway. Also, for scripts that have inline text content,
we don't need to delay them either, as they will become ready before
returning from "prepare script".
This makes the "load" event finally fire on lots of websites, including
Wikipedia. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/Parser')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index a2b41c4540..203fcf2456 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -2094,10 +2094,6 @@ void HTMLParser::handle_text(HTMLToken& token) 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. |