diff options
author | Ms2ger <ms2ger@gmail.com> | 2013-12-23 12:21:18 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2013-12-23 12:21:18 +0100 |
commit | e64ee3557e39e70bec10451138b92448a71d5de2 (patch) | |
tree | 7cbf4c517fc925fcd0516d42126c6d019d4978ba /src | |
parent | acdc0e1afa166db978c36236c94fa139b3ca9a88 (diff) | |
download | servo-e64ee3557e39e70bec10451138b92448a71d5de2.tar.gz servo-e64ee3557e39e70bec10451138b92448a71d5de2.zip |
Pass a Namespace to Element::get_attribute.
Diffstat (limited to 'src')
-rw-r--r-- | src/components/script/dom/element.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index 31dd20596f4..b1273a32886 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -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| { @@ -163,7 +162,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()) + let namespace = Namespace::from_str(ns_url); + self.get_attribute(namespace, name).map(|attr| attr.value.clone()) } pub fn set_attr(&mut self, abstract_self: AbstractNode, name: DOMString, value: DOMString) @@ -314,6 +314,7 @@ impl Element { } 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()) } |