From b71c1851b781754f96ac77a2012af19ad5e5467b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 18 Oct 2020 13:44:20 +0200 Subject: [PATCH] LibWeb: Dispatch "load" event on script elements --- Libraries/LibWeb/HTML/HTMLScriptElement.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 011778b2a6..da69c5ca55 100644 --- a/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,9 @@ void HTMLScriptElement::set_non_blocking(Badge, bool non_blo void HTMLScriptElement::execute_script() { document().run_javascript(m_script_source); + + if (has_attribute(HTML::AttributeNames::src)) + dispatch_event(DOM::Event::create("load")); } void HTMLScriptElement::prepare_script(Badge)