mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-23 01:39:55 +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:
@@ -29,7 +29,10 @@ HTMLScriptElement::~HTMLScriptElement() = default;
|
||||
void HTMLScriptElement::set_parser_document(Badge<HTMLParser>, DOM::Document& document)
|
||||
{
|
||||
m_parser_document = document;
|
||||
}
|
||||
|
||||
void HTMLScriptElement::begin_delaying_document_load_event(Badge<HTMLParser>, DOM::Document& document)
|
||||
{
|
||||
// https://html.spec.whatwg.org/multipage/scripting.html#concept-script-script
|
||||
// The user agent must delay the load event of the element's node document until the script is ready.
|
||||
m_document_load_event_delayer.emplace(document);
|
||||
|
||||
Reference in New Issue
Block a user