From 5d2b741ec9869b5e8948e247b7bf6db9cefeed13 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Wed, 16 Mar 2022 00:11:39 +0000 Subject: [PATCH] LibWeb: Add hack to dispatch load event for s This increases our Acid3 score to 81/100 on the live website, and fixes the 5 second spin locally. --- Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 3c46719973..7da61598b6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -21,11 +21,15 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName m_image_loader.on_load = [this] { m_should_show_fallback_content = false; set_needs_style_update(true); + // FIXME: This should be done by the HTML^Wdocument parser. + dispatch_event(DOM::Event::create(HTML::EventNames::load)); }; m_image_loader.on_fail = [this] { m_should_show_fallback_content = true; set_needs_style_update(true); + // FIXME: This should be done by the HTML^Wdocument parser. + dispatch_event(DOM::Event::create(HTML::EventNames::load)); }; }