summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp')
-rw-r--r--Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp b/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp
index 2f204692b6..7de6600c8d 100644
--- a/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp
+++ b/Libraries/LibWeb/HTML/Parser/HTMLDocumentParser.cpp
@@ -33,6 +33,7 @@
#include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/Text.h>
+#include <LibWeb/DOM/Window.h>
#include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLHeadElement.h>
#include <LibWeb/HTML/HTMLScriptElement.h>
@@ -165,6 +166,10 @@ void HTMLDocumentParser::run(const URL& url)
m_document->dispatch_event(DOM::Event::create("DOMContentLoaded"));
+ // FIXME: These are not in the right place, they should only fire once subresources are ready.
+ m_document->dispatch_event(DOM::Event::create("load"));
+ m_document->window().dispatch_event(DOM::Event::create("load"));
+
auto scripts_to_execute_as_soon_as_possible = m_document->take_scripts_to_execute_as_soon_as_possible({});
for (auto& script : scripts_to_execute_as_soon_as_possible) {
script.execute_script();