diff --git a/src/components/main/css/matching.rs b/src/components/main/css/matching.rs index 7b5961fd0bd..0f56c74fdfc 100644 --- a/src/components/main/css/matching.rs +++ b/src/components/main/css/matching.rs @@ -14,6 +14,7 @@ use script::layout_interface::LayoutChan; use servo_util::cache::{Cache, LRUCache, SimpleHashCache}; use servo_util::namespace::Null; use servo_util::smallvec::{SmallVec, SmallVec0, SmallVec16}; +use servo_util::str::DOMString; use std::cast; use std::to_bytes; use std::vec::VecIterator; @@ -161,9 +162,9 @@ struct StyleSharingCandidate { priv parent_style: Arc, // TODO(pcwalton): Intern. - priv local_name: ~str, + priv local_name: DOMString, - priv class: Option<~str>, + priv class: Option, } impl Eq for StyleSharingCandidate { diff --git a/src/components/script/dom/documenttype.rs b/src/components/script/dom/documenttype.rs index ee2e18ea969..f161b287702 100644 --- a/src/components/script/dom/documenttype.rs +++ b/src/components/script/dom/documenttype.rs @@ -16,9 +16,9 @@ pub struct DocumentType { } impl DocumentType { - pub fn new_inherited(name: ~str, - public_id: Option<~str>, - system_id: Option<~str>, + pub fn new_inherited(name: DOMString, + public_id: Option, + system_id: Option, document: AbstractDocument) -> DocumentType { DocumentType { @@ -29,9 +29,9 @@ impl DocumentType { } } - pub fn new(name: ~str, - public_id: Option<~str>, - system_id: Option<~str>, + pub fn new(name: DOMString, + public_id: Option, + system_id: Option, document: AbstractDocument) -> AbstractNode { let documenttype = DocumentType::new_inherited(name, diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index 1404a4f0347..08b99a4e015 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -31,7 +31,7 @@ use std::unstable::raw::Box; pub struct Element { node: Node, - tag_name: ~str, // TODO: This should be an atom, not a ~str. + tag_name: DOMString, // TODO: This should be an atom, not a DOMString. namespace: Namespace, attrs: ~[@mut Attr], style_attribute: Option, diff --git a/src/components/style/selector_matching.rs b/src/components/style/selector_matching.rs index 4d646964c37..a113ccea12c 100644 --- a/src/components/style/selector_matching.rs +++ b/src/components/style/selector_matching.rs @@ -11,6 +11,7 @@ use std::to_bytes; use servo_util::namespace; use servo_util::smallvec::SmallVec; use servo_util::sort; +use servo_util::str::DOMString; use media_queries::{Device, Screen}; use node::{TElement, TNode}; @@ -31,8 +32,8 @@ static SELECTOR_WHITESPACE: &'static [char] = &'static [' ', '\t', '\n', '\r', ' /// string. struct LowercaseAsciiString<'a>(&'a str); -impl<'a> Equiv<~str> for LowercaseAsciiString<'a> { - fn equiv(&self, other: &~str) -> bool { +impl<'a> Equiv for LowercaseAsciiString<'a> { + fn equiv(&self, other: &DOMString) -> bool { let LowercaseAsciiString(this) = *self; this.eq_ignore_ascii_case(*other) } @@ -79,9 +80,9 @@ impl<'a> IterBytes for LowercaseAsciiString<'a> { struct SelectorMap { // TODO: Tune the initial capacity of the HashMap // FIXME: Use interned strings - id_hash: HashMap<~str, ~[Rule]>, - class_hash: HashMap<~str, ~[Rule]>, - element_hash: HashMap<~str, ~[Rule]>, + id_hash: HashMap, + class_hash: HashMap, + element_hash: HashMap, // For Rules that don't have ID, class, or element selectors. universal_rules: ~[Rule], /// Whether this hash is empty. @@ -163,7 +164,7 @@ impl SelectorMap { N:TNode, V:SmallVec>( node: &N, - hash: &HashMap<~str,~[Rule]>, + hash: &HashMap, key: &str, matching_rules: &mut V, shareable: &mut bool) { @@ -179,7 +180,7 @@ impl SelectorMap { N:TNode, V:SmallVec>( node: &N, - hash: &HashMap<~str,~[Rule]>, + hash: &HashMap, key: &str, matching_rules: &mut V, shareable: &mut bool) {