mirror of
https://github.com/servo/servo.git
synced 2025-06-25 09:34:32 +01:00
Move Node.namespaceURI to Element.(fixes #2059)
This commit is contained in:
parent
7541b57526
commit
77941dc996
4 changed files with 8 additions and 10 deletions
|
@ -443,6 +443,11 @@ impl Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Element {
|
impl Element {
|
||||||
|
// http://dom.spec.whatwg.org/#dom-element-namespaceuri
|
||||||
|
pub fn NamespaceURI(&self) -> DOMString {
|
||||||
|
self.namespace.to_str().to_owned()
|
||||||
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-element-tagname
|
// http://dom.spec.whatwg.org/#dom-element-tagname
|
||||||
pub fn TagName(&self) -> DOMString {
|
pub fn TagName(&self) -> DOMString {
|
||||||
self.tag_name.to_ascii_upper()
|
self.tag_name.to_ascii_upper()
|
||||||
|
|
|
@ -1733,12 +1733,6 @@ impl Node {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-namespaceuri
|
|
||||||
pub fn GetNamespaceURI(&self, abstract_self: &JS<Node>) -> Option<DOMString> {
|
|
||||||
let element: Option<JS<Element>> = ElementCast::to(abstract_self);
|
|
||||||
element.map(|element| element.get().namespace.to_str().to_owned())
|
|
||||||
}
|
|
||||||
|
|
||||||
// http://dom.spec.whatwg.org/#dom-node-prefix
|
// http://dom.spec.whatwg.org/#dom-node-prefix
|
||||||
pub fn GetPrefix(&self) -> Option<DOMString> {
|
pub fn GetPrefix(&self) -> Option<DOMString> {
|
||||||
None
|
None
|
||||||
|
|
|
@ -18,10 +18,11 @@ interface Element : Node {
|
||||||
We haven't moved these from Node to Element like the spec wants.
|
We haven't moved these from Node to Element like the spec wants.
|
||||||
|
|
||||||
[Throws]
|
[Throws]
|
||||||
readonly attribute DOMString? namespaceURI;
|
|
||||||
readonly attribute DOMString? prefix;
|
readonly attribute DOMString? prefix;
|
||||||
readonly attribute DOMString localName;
|
readonly attribute DOMString localName;
|
||||||
*/
|
*/
|
||||||
|
[Constant]
|
||||||
|
readonly attribute DOMString namespaceURI;
|
||||||
// Not [Constant] because it depends on which document we're in
|
// Not [Constant] because it depends on which document we're in
|
||||||
[Pure]
|
[Pure]
|
||||||
readonly attribute DOMString tagName;
|
readonly attribute DOMString tagName;
|
||||||
|
|
|
@ -79,11 +79,9 @@ interface Node : EventTarget {
|
||||||
|
|
||||||
// Mozilla-specific stuff
|
// Mozilla-specific stuff
|
||||||
// These have been moved to Element in the spec.
|
// These have been moved to Element in the spec.
|
||||||
// If we move namespaceURI, prefix and localName to Element they should return
|
// If we move prefix and localName to Element they should return
|
||||||
// a non-nullable type.
|
// a non-nullable type.
|
||||||
[Constant]
|
[Constant]
|
||||||
readonly attribute DOMString? namespaceURI;
|
|
||||||
[Constant]
|
|
||||||
readonly attribute DOMString? prefix;
|
readonly attribute DOMString? prefix;
|
||||||
[Constant]
|
[Constant]
|
||||||
readonly attribute DOMString? localName;
|
readonly attribute DOMString? localName;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue