From 83cb35b60f63af0d1134d0a855a7d30f166414a6 Mon Sep 17 00:00:00 2001 From: Srikavin Ramkumar Date: Sat, 7 Jan 2023 23:33:23 +0530 Subject: [PATCH] LibWeb: Run object representation steps on element creation Prior to this change, fallback content inside an object tag would not be rendered on page load. --- Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 10a81b0c6e..e85b42c5aa 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -20,6 +20,14 @@ HTMLObjectElement::HTMLObjectElement(DOM::Document& document, DOM::QualifiedName : BrowsingContextContainer(document, move(qualified_name)) { set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLObjectElement")); + + // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element + // Whenever one of the following conditions occur: + // - the element is created, + // ...the user agent must queue an element task on the DOM manipulation task source given + // the object element to run the following steps to (re)determine what the object element represents. + // This task being queued or actively running must delay the load event of the element's node document. + queue_element_task_to_run_object_representation_steps(); } HTMLObjectElement::~HTMLObjectElement() = default;