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
commit 7c3db526b0
Notes: sideshowbarker 2024-07-17 07:28:23 +09:00
76 changed files with 892 additions and 565 deletions

View file

@ -26,7 +26,7 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
set_needs_style_update(true);
this->document().set_needs_layout();
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
dispatch_event(DOM::Event::create(EventNames::load));
dispatch_event(*DOM::Event::create(this->document().preferred_window_object(), EventNames::load));
});
};
@ -35,7 +35,7 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName q
set_needs_style_update(true);
this->document().set_needs_layout();
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
dispatch_event(DOM::Event::create(EventNames::error));
dispatch_event(*DOM::Event::create(this->document().preferred_window_object(), EventNames::error));
});
};