mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 19:24:57 +00:00
LibWeb: Add HTML::EventNames and UIEvents::EventNames
This commit is contained in:
parent
e68348298f
commit
9950270808
15 changed files with 271 additions and 19 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <LibWeb/CSS/StyleResolver.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/HTML/EventNames.h>
|
||||
#include <LibWeb/HTML/HTMLImageElement.h>
|
||||
#include <LibWeb/Layout/ImageBox.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
|
@ -41,13 +42,13 @@ HTMLImageElement::HTMLImageElement(DOM::Document& document, const QualifiedName&
|
|||
{
|
||||
m_image_loader.on_load = [this] {
|
||||
this->document().update_layout();
|
||||
dispatch_event(DOM::Event::create("load"));
|
||||
dispatch_event(DOM::Event::create(EventNames::load));
|
||||
};
|
||||
|
||||
m_image_loader.on_fail = [this] {
|
||||
dbg() << "HTMLImageElement: Resource did fail: " << this->src();
|
||||
this->document().update_layout();
|
||||
dispatch_event(DOM::Event::create("error"));
|
||||
dispatch_event(DOM::Event::create(EventNames::error));
|
||||
};
|
||||
|
||||
m_image_loader.on_animate = [this] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue