diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-11-20 17:18:29 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-11-20 17:18:29 -0700 |
commit | c23bfdf1c52cdd42c37cd931525c23e22f1d289f (patch) | |
tree | a049ce1233d895598749ad25e015b9566c875fd1 | |
parent | 32d765fb049318f2ff22f39fdeb9fa258ec8a174 (diff) | |
parent | a87391169d5487be28f796ea3b284e702db55190 (diff) | |
download | servo-c23bfdf1c52cdd42c37cd931525c23e22f1d289f.tar.gz servo-c23bfdf1c52cdd42c37cd931525c23e22f1d289f.zip |
auto merge of #4050 : mttr/servo/implement_attr_nodevalue, r=Ms2ger
Fixes #4047, and updates to expect tests that are now passing because of it.
-rw-r--r-- | components/script/dom/attr.rs | 8 | ||||
-rw-r--r-- | components/script/dom/webidls/Attr.webidl | 1 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/interfaces.html.ini | 4 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/nodes/attributes.html.ini | 24 |
4 files changed, 23 insertions, 14 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 95e05f8e79d..79f82f37aef 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -152,6 +152,14 @@ impl<'a> AttrMethods for JSRef<'a, Attr> { self.SetValue(value) } + fn NodeValue(self) -> DOMString { + self.Value() + } + + fn SetNodeValue(self, value: DOMString) { + self.SetValue(value) + } + fn Name(self) -> DOMString { self.name.as_slice().to_string() } diff --git a/components/script/dom/webidls/Attr.webidl b/components/script/dom/webidls/Attr.webidl index 3c7478c3851..356bc7ed26e 100644 --- a/components/script/dom/webidls/Attr.webidl +++ b/components/script/dom/webidls/Attr.webidl @@ -15,6 +15,7 @@ interface Attr { readonly attribute DOMString name; attribute DOMString value; attribute DOMString textContent; // alias of .value + attribute DOMString nodeValue; // alias of .value readonly attribute Element? ownerElement; diff --git a/tests/wpt/metadata/dom/interfaces.html.ini b/tests/wpt/metadata/dom/interfaces.html.ini index 77ab75c4e3b..a25bfd1c677 100644 --- a/tests/wpt/metadata/dom/interfaces.html.ini +++ b/tests/wpt/metadata/dom/interfaces.html.ini @@ -1165,8 +1165,8 @@ expected: FAIL [Attr interface: attribute nodeValue] - expected: FAIL + expected: PASS [Attr interface: document.querySelector("[id\]").attributes[0\] must inherit property "nodeValue" with the proper type (5)] - expected: FAIL + expected: PASS diff --git a/tests/wpt/metadata/dom/nodes/attributes.html.ini b/tests/wpt/metadata/dom/nodes/attributes.html.ini index e5932c51a18..e7f1a3be638 100644 --- a/tests/wpt/metadata/dom/nodes/attributes.html.ini +++ b/tests/wpt/metadata/dom/nodes/attributes.html.ini @@ -16,38 +16,38 @@ expected: FAIL [setAttribute should not change the order of previously set attributes.] - expected: FAIL + expected: PASS [setAttribute should set the first attribute with the given name] - expected: FAIL + expected: PASS [null and the empty string should result in a null namespace.] - expected: FAIL + expected: PASS [XML-namespaced attributes don\'t need an xml prefix] - expected: FAIL + expected: PASS [xmlns should be allowed as local name] - expected: FAIL + expected: PASS [xmlns should be allowed as prefix in the XMLNS namespace] - expected: FAIL + expected: PASS [xmlns should be allowed as qualified name in the XMLNS namespace] - expected: FAIL + expected: PASS [Setting the same attribute with another prefix should not change the prefix] - expected: FAIL + expected: PASS [Attributes should work in document fragments.] - expected: FAIL + expected: PASS [Attribute values should not be parsed.] - expected: FAIL + expected: PASS [Specified attributes should be accessible.] - expected: FAIL + expected: PASS [Entities in attributes should have been expanded while parsing.] - expected: FAIL + expected: PASS |