mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 20:32:56 +03:00
LibWeb: Dispatch "load" event on script elements
This commit is contained in:
parent
b92bc9c6e5
commit
b71c1851b7
Notes:
sideshowbarker
2024-07-19 01:51:52 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b71c1851b78
@ -27,6 +27,7 @@
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibJS/Parser.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/HTML/HTMLScriptElement.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
@ -55,6 +56,9 @@ void HTMLScriptElement::set_non_blocking(Badge<HTMLDocumentParser>, 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<HTMLDocumentParser>)
|
||||
|
Loading…
Reference in New Issue
Block a user