1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 22:34:59 +00:00

LibWeb: Add HTML::EventNames and UIEvents::EventNames

This commit is contained in:
Luke 2020-11-21 19:15:57 +00:00 committed by Andreas Kling
parent e68348298f
commit 9950270808
15 changed files with 271 additions and 19 deletions

View file

@ -35,6 +35,7 @@
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/Text.h>
#include <LibWeb/DOM/Window.h>
#include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLHeadElement.h>
#include <LibWeb/HTML/HTMLScriptElement.h>
@ -180,7 +181,7 @@ void HTMLDocumentParser::run(const URL& url)
script.execute_script();
}
auto content_loaded_event = DOM::Event::create("DOMContentLoaded");
auto content_loaded_event = DOM::Event::create(HTML::EventNames::DOMContentLoaded);
content_loaded_event->set_bubbles(true);
m_document->dispatch_event(content_loaded_event);
@ -192,7 +193,7 @@ void HTMLDocumentParser::run(const URL& url)
// FIXME: Spin the event loop until there is nothing that delays the load event in the Document.
m_document->set_ready_state("complete");
m_document->window().dispatch_event(DOM::Event::create("load"));
m_document->window().dispatch_event(DOM::Event::create(HTML::EventNames::load));
m_document->set_ready_for_post_load_tasks(true);
m_document->completely_finish_loading();