mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Add HTML::EventNames and UIEvents::EventNames
This commit is contained in:
parent
e68348298f
commit
9950270808
Notes:
sideshowbarker
2024-07-19 01:18:34 +09:00
Author: https://github.com/Lubrsi
Commit: 9950270808
Pull-request: https://github.com/SerenityOS/serenity/pull/4131
Reviewed-by: https://github.com/awesomekling
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