diff options
Diffstat (limited to 'src/components/script/dom/element.rs')
-rw-r--r-- | src/components/script/dom/element.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index 31dd20596f4..ba08e3660c6 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -16,7 +16,7 @@ use dom::document::AbstractDocument; use dom::node::{AbstractNode, ElementNodeTypeId, Node}; use dom::document; use dom::namespace; -use dom::namespace::Namespace; +use dom::namespace::{Namespace, Null}; use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery}; use layout_interface::{ContentBoxesResponse, ContentChangedDocumentDamage}; use layout_interface::{MatchSelectorsDocumentDamage}; @@ -149,9 +149,8 @@ impl<'self> Element { } pub fn get_attribute(&self, - namespace_url: Option<DOMString>, + namespace: Namespace, name: &str) -> Option<@mut Attr> { - let namespace = Namespace::from_str(namespace_url); // FIXME: only case-insensitive in the HTML namespace (as opposed to SVG, etc.) let name = name.to_ascii_lower(); self.attrs.find_equiv(&name).and_then(|attrs| { @@ -162,8 +161,8 @@ impl<'self> Element { } // FIXME(pcwalton): This is kind of confusingly named relative to the above... - pub fn get_attr(&self, ns_url: Option<~str>, name: &str) -> Option<~str> { - self.get_attribute(ns_url, name).map(|attr| attr.value.clone()) + pub fn get_attr(&self, namespace: Namespace, name: &str) -> Option<~str> { + self.get_attribute(namespace, name).map(|attr| attr.value.clone()) } pub fn set_attr(&mut self, abstract_self: AbstractNode, name: DOMString, value: DOMString) @@ -287,7 +286,7 @@ impl Element { } pub fn Id(&self, _abstract_self: AbstractNode) -> DOMString { - match self.get_attr(None, "id") { + match self.get_attr(Null, "id") { Some(x) => x, None => ~"" } @@ -310,10 +309,11 @@ impl Element { } pub fn GetAttribute(&self, name: DOMString) -> Option<DOMString> { - self.get_attr(None, name).map(|s| s.to_owned()) + self.get_attr(Null, name).map(|s| s.to_owned()) } pub fn GetAttributeNS(&self, namespace: Option<DOMString>, local_name: DOMString) -> Option<DOMString> { + let namespace = Namespace::from_str(namespace); self.get_attribute(namespace, local_name) .map(|attr| attr.value.clone()) } |