mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Run object representation steps on specified attribute updates
This commit is contained in:
parent
83cb35b60f
commit
1c2e7b1e47
Notes:
sideshowbarker
2024-07-17 01:55:35 +09:00
Author: https://github.com/srikavin Commit: https://github.com/SerenityOS/serenity/commit/1c2e7b1e47 Pull-request: https://github.com/SerenityOS/serenity/pull/16890 Reviewed-by: https://github.com/AtkinsSJ
2 changed files with 15 additions and 1 deletions
|
@ -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) \
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue