mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Make DOM::Event and all its subclasses GC-allocated
This commit is contained in:
parent
a4ddb0ef87
commit
7c3db526b0
Notes:
sideshowbarker
2024-07-17 07:28:23 +09:00
Author: https://github.com/awesomekling
Commit: 7c3db526b0
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
76 changed files with 892 additions and 565 deletions
|
@ -48,7 +48,7 @@ void HTMLScriptElement::execute_script()
|
|||
// 3. If the script's script is null for scriptElement, then fire an event named error at scriptElement, and return.
|
||||
if (!m_script) {
|
||||
dbgln("HTMLScriptElement: Refusing to run script because the script's script is null.");
|
||||
dispatch_event(DOM::Event::create(HTML::EventNames::error));
|
||||
dispatch_event(*DOM::Event::create(document().preferred_window_object(), HTML::EventNames::error));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ void HTMLScriptElement::execute_script()
|
|||
|
||||
// 7. If scriptElement is from an external file, then fire an event named load at scriptElement.
|
||||
if (m_from_an_external_file)
|
||||
dispatch_event(DOM::Event::create(HTML::EventNames::load));
|
||||
dispatch_event(*DOM::Event::create(document().preferred_window_object(), HTML::EventNames::load));
|
||||
}
|
||||
|
||||
// https://mimesniff.spec.whatwg.org/#javascript-mime-type-essence-match
|
||||
|
@ -259,7 +259,7 @@ void HTMLScriptElement::prepare_script()
|
|||
if (src.is_empty()) {
|
||||
dbgln("HTMLScriptElement: Refusing to run script because the src attribute is empty.");
|
||||
queue_an_element_task(HTML::Task::Source::Unspecified, [this] {
|
||||
dispatch_event(DOM::Event::create(HTML::EventNames::error));
|
||||
dispatch_event(*DOM::Event::create(document().preferred_window_object(), HTML::EventNames::error));
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ void HTMLScriptElement::prepare_script()
|
|||
if (!url.is_valid()) {
|
||||
dbgln("HTMLScriptElement: Refusing to run script because the src URL '{}' is invalid.", url);
|
||||
queue_an_element_task(HTML::Task::Source::Unspecified, [this] {
|
||||
dispatch_event(DOM::Event::create(HTML::EventNames::error));
|
||||
dispatch_event(*DOM::Event::create(document().preferred_window_object(), HTML::EventNames::error));
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue