diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 6aeef3ce986..eab06c5c19d 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -1674,6 +1674,15 @@ impl ElementMethods for Element { } // Step 4. + if self.get_custom_element_definition().is_some() { + let old_name = old_attr.local_name().clone(); + let old_value = DOMString::from(&**old_attr.value()); + let new_value = DOMString::from(&**attr.value()); + let namespace = old_attr.namespace().clone(); + let reaction = CallbackReaction::AttributeChanged(old_name, Some(old_value), + Some(new_value), namespace); + ScriptThread::enqueue_callback_reaction(self, reaction, None); + } self.will_mutate_attr(attr); attr.set_owner(Some(self)); self.attrs.borrow_mut()[position] = JS::from_ref(attr); diff --git a/tests/wpt/metadata/custom-elements/reactions/Element.html.ini b/tests/wpt/metadata/custom-elements/reactions/Element.html.ini index 8661d431874..6efc95e4d19 100644 --- a/tests/wpt/metadata/custom-elements/reactions/Element.html.ini +++ b/tests/wpt/metadata/custom-elements/reactions/Element.html.ini @@ -6,12 +6,6 @@ [slot on Element must enqueue an attributeChanged reaction when replacing an existing attribute] expected: FAIL - [setAttributeNode on Element must enqueue an attributeChanged reaction when replacing an existing attribute] - expected: FAIL - - [setAttributeNodeNS on Element must enqueue an attributeChanged reaction when replacing an existing attribute] - expected: FAIL - [insertAdjacentHTML on Element must enqueue a connected reaction for a newly constructed custom element] expected: FAIL diff --git a/tests/wpt/metadata/custom-elements/reactions/NamedNodeMap.html.ini b/tests/wpt/metadata/custom-elements/reactions/NamedNodeMap.html.ini deleted file mode 100644 index f1dfcdc502e..00000000000 --- a/tests/wpt/metadata/custom-elements/reactions/NamedNodeMap.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[NamedNodeMap.html] - type: testharness - [setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute] - expected: FAIL - - [setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute] - expected: FAIL - diff --git a/tests/wpt/mozilla/meta/css/get-computed-style-for-url.html.ini b/tests/wpt/mozilla/meta/css/get-computed-style-for-url.html.ini index 3f3945a8eb3..4b9fd22e1df 100644 --- a/tests/wpt/mozilla/meta/css/get-computed-style-for-url.html.ini +++ b/tests/wpt/mozilla/meta/css/get-computed-style-for-url.html.ini @@ -1,6 +1,5 @@ [get-computed-style-for-url.html] type: testharness - [getComputedStyle(elem) for url() listStyle uses the resolved URL and elem.style uses the original URL] expected: FAIL bug: https://github.com/servo/servo/issues/18015