Implement nodeName on Attr

This commit is contained in:
David Zbarsky 2016-04-02 12:47:33 -07:00
parent 7f4929d52d
commit 8cbcdfb761
7 changed files with 10 additions and 80 deletions

View file

@ -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;

View file

@ -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;