diff options
author | Keegan McAllister <kmcallister@mozilla.com> | 2014-09-29 18:30:01 -0700 |
---|---|---|
committer | Keegan McAllister <kmcallister@mozilla.com> | 2014-09-29 21:40:54 -0700 |
commit | d50114c41d5233bc55ad1b86273995c0fa3f8d62 (patch) | |
tree | 1b11383f0fdfab841f3cc77c680226b9bc10aa59 /components/script/dom/attr.rs | |
parent | 6429750b339ca45651ac3a45df380f1badd3917c (diff) | |
download | servo-d50114c41d5233bc55ad1b86273995c0fa3f8d62.tar.gz servo-d50114c41d5233bc55ad1b86273995c0fa3f8d62.zip |
Use string-cache's Namespace type
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r-- | components/script/dom/attr.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index bd2d90e2ec6..6dff298c95f 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -15,13 +15,11 @@ use dom::window::Window; use dom::virtualmethods::vtable_for; use devtools_traits::AttrInfo; -use servo_util::namespace; -use servo_util::namespace::Namespace; use servo_util::str::{DOMString, split_html_space_chars}; use std::cell::{Ref, RefCell}; use std::mem; use std::slice::Items; -use string_cache::Atom; +use string_cache::{Atom, Namespace}; pub enum AttrSettingType { FirstSetAttr, @@ -136,7 +134,8 @@ impl<'a> AttrMethods for JSRef<'a, Attr> { } fn GetNamespaceURI(self) -> Option<DOMString> { - match self.namespace.to_str() { + let Namespace(ref atom) = self.namespace; + match atom.as_slice() { "" => None, url => Some(url.to_string()), } @@ -158,7 +157,7 @@ impl<'a> AttrHelpers<'a> for JSRef<'a, Attr> { fn set_value(self, set_type: AttrSettingType, value: AttrValue) { let owner = self.owner.root(); let node: JSRef<Node> = NodeCast::from_ref(*owner); - let namespace_is_null = self.namespace == namespace::Null; + let namespace_is_null = self.namespace == ns!(""); match set_type { ReplacedAttr => { @@ -189,8 +188,9 @@ impl<'a> AttrHelpers<'a> for JSRef<'a, Attr> { } fn summarize(self) -> AttrInfo { + let Namespace(ref ns) = self.namespace; AttrInfo { - namespace: self.namespace.to_str().to_string(), + namespace: ns.as_slice().to_string(), name: self.Name(), value: self.Value(), } |