Skip to content

Commit

Permalink
Return null when an attr's namespace is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrewster committed Jul 18, 2017
1 parent 2460997 commit 77efab8
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 197 deletions.
8 changes: 5 additions & 3 deletions components/script/dom/customelementregistry.rs
Expand Up @@ -600,9 +600,11 @@ impl CustomElementReactionStack {
unsafe { val.to_jsval(cx, value.handle_mut()); }
}

let namespace = DOMString::from(&*namespace);
rooted!(in(cx) let mut namespace_value = UndefinedValue());
unsafe { namespace.to_jsval(cx, namespace_value.handle_mut()); }
rooted!(in(cx) let mut namespace_value = NullValue());
if namespace != ns!() {
let namespace = DOMString::from(&*namespace);
unsafe { namespace.to_jsval(cx, namespace_value.handle_mut()); }
}

let args = vec![Heap::default(), Heap::default(), Heap::default(), Heap::default()];
args[0].set(name_value.get());
Expand Down
@@ -1,26 +1,5 @@
[attribute-changed-callback.html]
type: testharness
[setAttribute and removeAttribute must enqueue and invoke attributeChangedCallback]
expected: FAIL

[setAttributeNode and removeAttributeNode must enqueue and invoke attributeChangedCallback for an HTML attribute]
expected: FAIL

[Mutating attributeChangedCallback after calling customElements.define must not affect the callback being invoked]
expected: FAIL

[attributedChangedCallback must not be invoked when the observed attributes does not contain the attribute]
expected: FAIL

[Mutating observedAttributes after calling customElements.define must not affect the set of attributes for which attributedChangedCallback is invoked]
expected: FAIL

[attributedChangedCallback must be enqueued for attributes specified in a non-Array iterable observedAttributes]
expected: FAIL

[attributedChangedCallback must be enqueued for style attribute change by mutating inline style declaration]
expected: FAIL

[attributedChangedCallback must not be enqueued when mutating inline style declaration if the style attribute is not observed]
[Custom Elements: attributeChangedCallback]
expected: FAIL

5 changes: 0 additions & 5 deletions tests/wpt/metadata/custom-elements/reactions/Attr.html.ini

This file was deleted.

@@ -1,47 +1,5 @@
[CSSStyleDeclaration.html]
type: testharness
[cssText on CSSStyleDeclaration must enqueue an attributeChanged reaction when it adds the observed style attribute]
expected: FAIL

[cssText on CSSStyleDeclaration must enqueue an attributeChanged reaction when it mutates the observed style attribute]
expected: FAIL

[setProperty on CSSStyleDeclaration must enqueue an attributeChanged reaction when it adds the observed style attribute]
expected: FAIL

[setProperty on CSSStyleDeclaration must enqueue an attributeChanged reaction when it mutates the observed style attribute]
expected: FAIL

[setProperty on CSSStyleDeclaration must enqueue an attributeChanged reaction when it makes a property important and the style attribute is observed]
expected: FAIL

[setPropertyValue on CSSStyleDeclaration must enqueue an attributeChanged reaction when it adds the observed style attribute]
expected: FAIL

[setPropertyValue on CSSStyleDeclaration must enqueue an attributeChanged reaction when it mutates the observed style attribute]
expected: FAIL

[setPropertyPriority on CSSStyleDeclaration must enqueue an attributeChanged reaction when it makes a property important and the style attribute is observed]
expected: FAIL

[removeProperty on CSSStyleDeclaration must enqueue an attributeChanged reaction when it removes a property from the observed style attribute]
expected: FAIL

[cssFloat on CSSStyleDeclaration must enqueue an attributeChanged reaction when it adds the observed style attribute]
expected: FAIL

[A camel case attribute (borderWidth) on CSSStyleDeclaration must enqueue an attributeChanged reaction when it adds the observed style attribute]
expected: FAIL

[A camel case attribute (borderWidth) on CSSStyleDeclaration must enqueue an attributeChanged reaction when it mutates the observed style attribute]
expected: FAIL

[A dashed property (border-width) on CSSStyleDeclaration must enqueue an attributeChanged reaction when it adds the observed style attribute]
expected: FAIL

[A dashed property (border-width) on CSSStyleDeclaration must enqueue an attributeChanged reaction when it mutates the observed style attribute]
expected: FAIL

[A webkit prefixed camel case attribute (webkitFilter) on CSSStyleDeclaration must enqueue an attributeChanged reaction when it adds the observed style attribute]
expected: FAIL

Expand Down
14 changes: 0 additions & 14 deletions tests/wpt/metadata/custom-elements/reactions/DOMStringMap.html.ini

This file was deleted.

36 changes: 0 additions & 36 deletions tests/wpt/metadata/custom-elements/reactions/DOMTokenList.html.ini
@@ -1,41 +1,5 @@
[DOMTokenList.html]
type: testharness
[add on DOMTokenList must enqueue an attributeChanged reaction when adding an attribute]
expected: FAIL

[add on DOMTokenList must enqueue an attributeChanged reaction when adding a value to an existing attribute]
expected: FAIL

[add on DOMTokenList must enqueue exactly one attributeChanged reaction when adding multiple values to an attribute]
expected: FAIL

[remove on DOMTokenList must enqueue an attributeChanged reaction when removing a value from an attribute]
expected: FAIL

[remove on DOMTokenList must enqueue exactly one attributeChanged reaction when removing multiple values to an attribute]
expected: FAIL

[remove on DOMTokenList must enqueue an attributeChanged reaction even when removing a non-existent value from an attribute]
expected: FAIL

[toggle on DOMTokenList must enqueue an attributeChanged reaction when adding a value to an attribute]
expected: FAIL

[toggle on DOMTokenList must enqueue an attributeChanged reaction when removing a value from an attribute]
expected: FAIL

[replace on DOMTokenList must enqueue an attributeChanged reaction when replacing a value in an attribute]
expected: FAIL

[replace on DOMTokenList must not enqueue an attributeChanged reaction when the token to replace does not exist in the attribute]
expected: FAIL

[the stringifier of DOMTokenList must enqueue an attributeChanged reaction when adding an observed attribute]
expected: FAIL

[the stringifier of DOMTokenList must enqueue an attributeChanged reaction when mutating the value of an observed attribute]
expected: FAIL

[the stringifier of DOMTokenList must enqueue an attributeChanged reaction when the setter is called with the original value of the attribute]
expected: FAIL

39 changes: 0 additions & 39 deletions tests/wpt/metadata/custom-elements/reactions/Element.html.ini
@@ -1,56 +1,17 @@
[Element.html]
type: testharness
[id on Element must enqueue an attributeChanged reaction when adding id content attribute]
expected: FAIL

[id on Element must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[className on Element must enqueue an attributeChanged reaction when adding class content attribute]
expected: FAIL

[className on Element must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[slot on Element must enqueue an attributeChanged reaction when adding slot content attribute]
expected: FAIL

[slot on Element must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[setAttribute on Element must enqueue an attributeChanged reaction when adding an attribute]
expected: FAIL

[setAttribute on Element must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[setAttributeNS on Element must enqueue an attributeChanged reaction when adding an attribute]
expected: FAIL

[setAttributeNS on Element must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[removeAttribute on Element must enqueue an attributeChanged reaction when removing an existing attribute]
expected: FAIL

[removeAttributeNS on Element must enqueue an attributeChanged reaction when removing an existing attribute]
expected: FAIL

[setAttributeNode on Element must enqueue an attributeChanged reaction when adding an 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 adding an attribute]
expected: FAIL

[setAttributeNodeNS on Element must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[removeAttributeNode on Element must enqueue an attributeChanged reaction when removing an existing attribute]
expected: FAIL

[innerHTML on Element must enqueue a connected reaction for a newly constructed custom element]
expected: FAIL

Expand Down
18 changes: 0 additions & 18 deletions tests/wpt/metadata/custom-elements/reactions/HTMLElement.html.ini
@@ -1,17 +1,5 @@
[HTMLElement.html]
type: testharness
[title on HTMLElement must enqueue an attributeChanged reaction when adding title content attribute]
expected: FAIL

[title on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[lang on HTMLElement must enqueue an attributeChanged reaction when adding lang content attribute]
expected: FAIL

[lang on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[translate on HTMLElement must enqueue an attributeChanged reaction when adding translate content attribute]
expected: FAIL

Expand All @@ -24,12 +12,6 @@
[dir on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[hidden on HTMLElement must enqueue an attributeChanged reaction when adding hidden content attribute]
expected: FAIL

[hidden on HTMLElement must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[tabIndex on HTMLElement must enqueue an attributeChanged reaction when adding tabindex content attribute]
expected: FAIL

Expand Down
12 changes: 0 additions & 12 deletions tests/wpt/metadata/custom-elements/reactions/NamedNodeMap.html.ini
@@ -1,20 +1,8 @@
[NamedNodeMap.html]
type: testharness
[setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when adding an attribute]
expected: FAIL

[setNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when adding an attribute]
expected: FAIL

[setNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[removeNamedItem on NamedNodeMap must enqueue an attributeChanged reaction when removing an existing attribute]
expected: FAIL

[removeNamedItemNS on NamedNodeMap must enqueue an attributeChanged reaction when removing an existing attribute]
expected: FAIL

6 changes: 0 additions & 6 deletions tests/wpt/metadata/custom-elements/reactions/Node.html.ini
@@ -1,11 +1,5 @@
[Node.html]
type: testharness
[nodeValue on Node must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[textContent on Node must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

[cloneNode on Node must enqueue an attributeChanged reaction when cloning an element with an observed attribute]
expected: FAIL

Expand Down

0 comments on commit 77efab8

Please sign in to comment.