diff options
-rw-r--r-- | components/script/dom/attr.rs | 16 | ||||
-rw-r--r-- | components/script/dom/webidls/Attr.webidl | 10 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/interfaces.html.ini | 18 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/nodes/attributes.html.ini | 34 |
4 files changed, 24 insertions, 54 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index bbb7325a7ae..324d17d6e14 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -141,6 +141,14 @@ impl<'a> AttrMethods for JSRef<'a, Attr> { self.set_value(ReplacedAttr, value); } + fn TextContent(self) -> DOMString { + self.Value() + } + + fn SetTextContent(self, value: DOMString) { + self.SetValue(value) + } + fn Name(self) -> DOMString { self.name.as_slice().to_string() } @@ -156,6 +164,14 @@ impl<'a> AttrMethods for JSRef<'a, Attr> { fn GetPrefix(self) -> Option<DOMString> { self.prefix.clone() } + + fn GetOwnerElement(self) -> Option<Temporary<Element>> { + Some(Temporary::new(self.owner)) + } + + fn Specified(self) -> bool { + true // Always returns true + } } pub trait AttrHelpers<'a> { diff --git a/components/script/dom/webidls/Attr.webidl b/components/script/dom/webidls/Attr.webidl index 2b3d18150d8..3c7478c3851 100644 --- a/components/script/dom/webidls/Attr.webidl +++ b/components/script/dom/webidls/Attr.webidl @@ -9,10 +9,14 @@ */ interface Attr { + readonly attribute DOMString? namespaceURI; + readonly attribute DOMString? prefix; readonly attribute DOMString localName; + readonly attribute DOMString name; attribute DOMString value; + attribute DOMString textContent; // alias of .value - readonly attribute DOMString name; - readonly attribute DOMString? namespaceURI; - readonly attribute DOMString? prefix; + readonly attribute Element? ownerElement; + + readonly attribute boolean specified; // useless; always returns true }; diff --git a/tests/wpt/metadata/dom/interfaces.html.ini b/tests/wpt/metadata/dom/interfaces.html.ini index a9941c22b00..ddc6ad2ed73 100644 --- a/tests/wpt/metadata/dom/interfaces.html.ini +++ b/tests/wpt/metadata/dom/interfaces.html.ini @@ -504,24 +504,6 @@ [NamedNodeMap interface: operation removeNamedItemNS(DOMString,DOMString)] expected: FAIL - [Attr interface: attribute textContent] - expected: FAIL - - [Attr interface: attribute ownerElement] - expected: FAIL - - [Attr interface: attribute specified] - expected: FAIL - - [Attr interface: document.querySelector("[id\]").attributes[0\] must inherit property "textContent" with the proper type (5)] - expected: FAIL - - [Attr interface: document.querySelector("[id\]").attributes[0\] must inherit property "ownerElement" with the proper type (6)] - expected: FAIL - - [Attr interface: document.querySelector("[id\]").attributes[0\] must inherit property "specified" with the proper type (7)] - expected: FAIL - [CharacterData interface: attribute previousElementSibling] expected: FAIL diff --git a/tests/wpt/metadata/dom/nodes/attributes.html.ini b/tests/wpt/metadata/dom/nodes/attributes.html.ini index 78a802084e5..69dbd55909a 100644 --- a/tests/wpt/metadata/dom/nodes/attributes.html.ini +++ b/tests/wpt/metadata/dom/nodes/attributes.html.ini @@ -1,9 +1,7 @@ [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] + [AttrExodus] expected: FAIL [setAttribute should set the attribute with the given qualified name] @@ -12,36 +10,6 @@ [When qualifiedName does not match the QName production, an NAMESPACE_ERR exception is to be thrown.] 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 - [First set attribute is returned by getAttribute] expected: FAIL |