diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-04 18:12:32 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-04 18:12:32 +0530 |
commit | ca3d120f4abaa40c9377ac450420372fd00cf668 (patch) | |
tree | d508d71101788394f311d20d98408589af71e4ac | |
parent | 3b2a1a3c47b4d10b25c6ac5546e027185907b7fa (diff) | |
parent | 8cbcdfb761cee62e05c45d76ec697bb4a120883f (diff) | |
download | servo-ca3d120f4abaa40c9377ac450420372fd00cf668.tar.gz servo-ca3d120f4abaa40c9377ac450420372fd00cf668.zip |
Auto merge of #10372 - dzbarsky:rmAttrNS, r=Ms2ger
Implement nodeName on Attr
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10372)
<!-- Reviewable:end -->
6 files changed, 9 insertions, 79 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index ec7b999f5b9..50a5a754f25 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -138,6 +138,11 @@ impl AttrMethods for Attr { DOMString::from(&*self.identifier.name) } + // https://dom.spec.whatwg.org/#dom-attr-nodename + fn NodeName(&self) -> DOMString { + self.Name() + } + // https://dom.spec.whatwg.org/#dom-attr-namespaceuri fn GetNamespaceURI(&self) -> Option<DOMString> { let Namespace(ref atom) = self.identifier.namespace; diff --git a/components/script/dom/webidls/Attr.webidl b/components/script/dom/webidls/Attr.webidl index e90bec8fccd..171715205bc 100644 --- a/components/script/dom/webidls/Attr.webidl +++ b/components/script/dom/webidls/Attr.webidl @@ -17,12 +17,14 @@ interface Attr { readonly attribute DOMString localName; [Constant] readonly attribute DOMString name; + [Constant] + readonly attribute DOMString nodeName; // historical alias of .name [Pure] attribute DOMString value; [Pure] - attribute DOMString textContent; // alias of .value + attribute DOMString textContent; // historical alias of .value [Pure] - attribute DOMString nodeValue; // alias of .value + attribute DOMString nodeValue; // historical alias of .value [Pure] readonly attribute Element? ownerElement; diff --git a/tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini b/tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini deleted file mode 100644 index 8a9eb43431a..00000000000 --- a/tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini +++ /dev/null @@ -1,26 +0,0 @@ -[Document-createAttribute.html] - type: testharness - [HTML document.createAttribute("title")] - expected: FAIL - - [XML document.createAttribute("title")] - expected: FAIL - - [HTML document.createAttribute("TITLE")] - expected: FAIL - - [XML document.createAttribute("TITLE")] - expected: FAIL - - [HTML document.createAttribute(null)] - expected: FAIL - - [XML document.createAttribute(null)] - expected: FAIL - - [HTML document.createAttribute(undefined)] - expected: FAIL - - [XML document.createAttribute(undefined)] - expected: FAIL - diff --git a/tests/wpt/metadata/dom/nodes/Element-removeAttributeNS.html.ini b/tests/wpt/metadata/dom/nodes/Element-removeAttributeNS.html.ini deleted file mode 100644 index ed13e73097b..00000000000 --- a/tests/wpt/metadata/dom/nodes/Element-removeAttributeNS.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Element-removeAttributeNS.html] - type: testharness - [removeAttributeNS should take a local name.] - expected: FAIL - diff --git a/tests/wpt/metadata/dom/nodes/attributes.html.ini b/tests/wpt/metadata/dom/nodes/attributes.html.ini deleted file mode 100644 index b1c954cb2cf..00000000000 --- a/tests/wpt/metadata/dom/nodes/attributes.html.ini +++ /dev/null @@ -1,41 +0,0 @@ -[attributes.html] - type: testharness - [setAttribute should not change the order of previously set attributes.] - expected: FAIL - - [setAttribute should set the first attribute with the given name] - expected: FAIL - - [setAttribute should set the attribute with the given qualified name] - expected: FAIL - - [null and the empty string should result in a null namespace.] - expected: FAIL - - [XML-namespaced attributes don't need an xml prefix] - expected: FAIL - - [xmlns should be allowed as local name] - expected: FAIL - - [xmlns should be allowed as prefix in the XMLNS namespace] - expected: FAIL - - [xmlns should be allowed as qualified name in the XMLNS namespace] - expected: FAIL - - [Setting the same attribute with another prefix should not change the prefix] - expected: FAIL - - [Attributes should work in document fragments.] - expected: FAIL - - [Attribute values should not be parsed.] - expected: FAIL - - [Specified attributes should be accessible.] - expected: FAIL - - [Entities in attributes should have been expanded while parsing.] - expected: FAIL - diff --git a/tests/wpt/metadata/html/dom/elements/global-attributes/custom-attrs.html.ini b/tests/wpt/metadata/html/dom/elements/global-attributes/custom-attrs.html.ini deleted file mode 100644 index 1081dd9595a..00000000000 --- a/tests/wpt/metadata/html/dom/elements/global-attributes/custom-attrs.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[custom-attrs.html] - type: testharness - [Setting an Element's dataset property should not interfere with namespaced attributes with same name] - expected: FAIL - |