diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/script/dom/attr.rs | 16 | ||||
-rw-r--r-- | components/script/dom/webidls/Attr.webidl | 10 |
2 files changed, 23 insertions, 3 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 }; |