|
@@ -22,13 +22,17 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, QualifiedName qualif
|
|
|
{
|
|
|
m_image_loader.on_load = [this] {
|
|
|
this->document().update_layout();
|
|
|
- dispatch_event(DOM::Event::create(EventNames::load));
|
|
|
+ queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
|
|
|
+ dispatch_event(DOM::Event::create(EventNames::load));
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
m_image_loader.on_fail = [this] {
|
|
|
dbgln("HTMLImageElement: Resource did fail: {}", src());
|
|
|
this->document().update_layout();
|
|
|
- dispatch_event(DOM::Event::create(EventNames::error));
|
|
|
+ queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {
|
|
|
+ dispatch_event(DOM::Event::create(EventNames::error));
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
m_image_loader.on_animate = [this] {
|