LibWeb: Run object representation steps on specified attribute updates

This commit is contained in:
Srikavin Ramkumar 2023-01-07 23:37:42 +05:30 committed by Andreas Kling
parent 83cb35b60f
commit 1c2e7b1e47
Notes: sideshowbarker 2024-07-17 01:55:35 +09:00
2 changed files with 15 additions and 1 deletions

View file

@ -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) \

View file

@ -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