Explorar o código

LibWeb: Add hack to dispatch load event for <object>s

This increases our Acid3 score to 81/100 on the live website, and fixes
the 5 second spin locally.
sin-ack %!s(int64=3) %!d(string=hai) anos
pai
achega
5d2b741ec9
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp

+ 4 - 0
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));
     };
 }