LibWeb: Make DOM::Event and all its subclasses GC-allocated

This commit is contained in:
Andreas Kling 2022-08-08 22:29:40 +02:00
parent a4ddb0ef87
commit 7c3db526b0
Notes: sideshowbarker 2024-07-17 07:28:23 +09:00
76 changed files with 892 additions and 565 deletions

View file

@ -96,7 +96,7 @@ void HTMLObjectElement::queue_element_task_to_run_object_representation_steps()
// 3. If that failed, fire an event named error at the element, then jump to the step below labeled fallback.
if (!url.is_valid()) {
dispatch_event(DOM::Event::create(HTML::EventNames::error));
dispatch_event(*DOM::Event::create(document().preferred_window_object(), HTML::EventNames::error));
return run_object_representation_fallback_steps();
}
@ -123,7 +123,7 @@ void HTMLObjectElement::queue_element_task_to_run_object_representation_steps()
void HTMLObjectElement::resource_did_fail()
{
// 4.7. If the load failed (e.g. there was an HTTP 404 error, there was a DNS error), fire an event named error at the element, then jump to the step below labeled fallback.
dispatch_event(DOM::Event::create(HTML::EventNames::error));
dispatch_event(*DOM::Event::create(document().preferred_window_object(), HTML::EventNames::error));
run_object_representation_fallback_steps();
}
@ -261,7 +261,7 @@ void HTMLObjectElement::run_object_representation_completed_steps(Representation
// 4.11. If the object element does not represent its nested browsing context, then once the resource is completely loaded, queue an element task on the DOM manipulation task source given the object element to fire an event named load at the element.
if (representation != Representation::NestedBrowsingContext) {
queue_an_element_task(HTML::Task::Source::DOMManipulation, [&]() {
dispatch_event(DOM::Event::create(HTML::EventNames::load));
dispatch_event(*DOM::Event::create(document().preferred_window_object(), HTML::EventNames::load));
});
}