diff --git a/Userland/Libraries/LibWeb/HTML/AttributeNames.h b/Userland/Libraries/LibWeb/HTML/AttributeNames.h index ab609ee5ba1..88d83e94d81 100644 --- a/Userland/Libraries/LibWeb/HTML/AttributeNames.h +++ b/Userland/Libraries/LibWeb/HTML/AttributeNames.h @@ -39,6 +39,7 @@ namespace AttributeNames { __ENUMERATE_HTML_ATTRIBUTE(checked) \ __ENUMERATE_HTML_ATTRIBUTE(cite) \ __ENUMERATE_HTML_ATTRIBUTE(class_) \ + __ENUMERATE_HTML_ATTRIBUTE(classid) \ __ENUMERATE_HTML_ATTRIBUTE(clear) \ __ENUMERATE_HTML_ATTRIBUTE(code) \ __ENUMERATE_HTML_ATTRIBUTE(codetype) \ diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index e85b42c5aa8..cfdc8dcfbf0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -36,8 +36,21 @@ void HTMLObjectElement::parse_attribute(FlyString const& name, DeprecatedString { BrowsingContextContainer::parse_attribute(name, value); - if (name == HTML::AttributeNames::data) + // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element + // Whenever one of the following conditions occur: + if ( + // - the element's classid attribute is set, changed, or removed, + (name == HTML::AttributeNames::classid) || + // - the element's classid attribute is not present, and its data attribute is set, changed, or removed, + (!has_attribute(HTML::AttributeNames::classid) && name == HTML::AttributeNames::data) || + // - neither the element's classid attribute nor its data attribute are present, and its type attribute is set, changed, or removed, + (!has_attribute(HTML::AttributeNames::classid) && !has_attribute(HTML::AttributeNames::data) && name == HTML::AttributeNames::type)) { + + // ...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(); + } } // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-object-data