diff options
Diffstat (limited to 'components/layout')
-rw-r--r-- | components/layout/Cargo.toml | 3 | ||||
-rw-r--r-- | components/layout/construct.rs | 2 | ||||
-rw-r--r-- | components/layout/css/matching.rs | 16 | ||||
-rw-r--r-- | components/layout/fragment.rs | 4 | ||||
-rw-r--r-- | components/layout/lib.rs | 3 | ||||
-rw-r--r-- | components/layout/query.rs | 2 | ||||
-rw-r--r-- | components/layout/wrapper.rs | 4 |
7 files changed, 16 insertions, 18 deletions
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 8e5d8cd7a34..c8ae6c3b236 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -71,8 +71,7 @@ rustc-serialize = "0.3" libc = "0.1" selectors = "0.2" smallvec = "0.1" -string_cache = "0.1" -string_cache_plugin = "0.1" +string_cache = "0.2" euclid = {version = "0.3", features = ["plugins"]} serde = "0.6" serde_macros = "0.6" diff --git a/components/layout/construct.rs b/components/layout/construct.rs index c09ecc7b173..73b81e2c54b 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -1642,7 +1642,7 @@ trait ObjectElement<'a> { impl<'ln> ObjectElement<'ln> for ServoThreadSafeLayoutNode<'ln> { fn get_type_and_data(&self) -> (Option<&'ln str>, Option<&'ln str>) { let elem = self.as_element(); - (elem.get_attr(&ns!(""), &atom!("type")), elem.get_attr(&ns!(""), &atom!("data"))) + (elem.get_attr(&ns!(), &atom!("type")), elem.get_attr(&ns!(), &atom!("data"))) } fn has_object_data(&self) -> bool { diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs index 4d969e00fd8..cec72c7a211 100644 --- a/components/layout/css/matching.rs +++ b/components/layout/css/matching.rs @@ -166,12 +166,12 @@ fn create_common_style_affecting_attributes_from_element(element: &ServoLayoutEl for attribute_info in &common_style_affecting_attributes() { match attribute_info.mode { CommonStyleAffectingAttributeMode::IsPresent(flag) => { - if element.get_attr(&ns!(""), &attribute_info.atom).is_some() { + if element.get_attr(&ns!(), &attribute_info.atom).is_some() { flags.insert(flag) } } CommonStyleAffectingAttributeMode::IsEqual(target_value, flag) => { - match element.get_attr(&ns!(""), &attribute_info.atom) { + match element.get_attr(&ns!(), &attribute_info.atom) { Some(element_value) if element_value == target_value => { flags.insert(flag) } @@ -248,7 +248,7 @@ impl StyleSharingCandidate { style: style, parent_style: parent_style, local_name: element.get_local_name().clone(), - class: element.get_attr(&ns!(""), &atom!("class")) + class: element.get_attr(&ns!(), &atom!("class")) .map(|string| string.to_owned()), link: element.is_link(), namespace: (*element.get_namespace()).clone(), @@ -263,7 +263,7 @@ impl StyleSharingCandidate { } // FIXME(pcwalton): Use `each_class` here instead of slow string comparison. - match (&self.class, element.get_attr(&ns!(""), &atom!("class"))) { + match (&self.class, element.get_attr(&ns!(), &atom!("class"))) { (&None, Some(_)) | (&Some(_), None) => return false, (&Some(ref this_class), Some(element_class)) if element_class != &**this_class => { @@ -289,12 +289,12 @@ impl StyleSharingCandidate { match attribute_info.mode { CommonStyleAffectingAttributeMode::IsPresent(flag) => { if self.common_style_affecting_attributes.contains(flag) != - element.get_attr(&ns!(""), &attribute_info.atom).is_some() { + element.get_attr(&ns!(), &attribute_info.atom).is_some() { return false } } CommonStyleAffectingAttributeMode::IsEqual(target_value, flag) => { - match element.get_attr(&ns!(""), &attribute_info.atom) { + match element.get_attr(&ns!(), &attribute_info.atom) { Some(ref element_value) if self.common_style_affecting_attributes .contains(flag) && *element_value != target_value => { @@ -313,7 +313,7 @@ impl StyleSharingCandidate { } for attribute_name in &rare_style_affecting_attributes() { - if element.get_attr(&ns!(""), attribute_name).is_some() { + if element.get_attr(&ns!(), attribute_name).is_some() { return false } } @@ -621,7 +621,7 @@ impl<'ln> ElementMatchMethods for ServoLayoutElement<'ln> { if self.style_attribute().is_some() { return StyleSharingResult::CannotShare } - if self.get_attr(&ns!(""), &atom!("id")).is_some() { + if self.get_attr(&ns!(), &atom!("id")).is_some() { return StyleSharingResult::CannotShare } diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index f2e0f270676..4bf083d107e 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -351,7 +351,7 @@ impl ImageFragmentInfo { -> ImageFragmentInfo { fn convert_length(node: &ServoThreadSafeLayoutNode, name: &Atom) -> Option<Au> { let element = node.as_element(); - element.get_attr(&ns!(""), name) + element.get_attr(&ns!(), name) .and_then(|string| string.parse().ok()) .map(Au::from_px) } @@ -760,7 +760,7 @@ impl TableColumnFragmentInfo { /// Create the information specific to an table column fragment. pub fn new(node: &ServoThreadSafeLayoutNode) -> TableColumnFragmentInfo { let element = node.as_element(); - let span = element.get_attr(&ns!(""), &atom!("span")) + let span = element.get_attr(&ns!(), &atom!("span")) .and_then(|string| string.parse().ok()) .unwrap_or(0); TableColumnFragmentInfo { diff --git a/components/layout/lib.rs b/components/layout/lib.rs index 2727000ef24..dd41d926b29 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -16,7 +16,6 @@ #![deny(unsafe_code)] -#![plugin(string_cache_plugin)] #![plugin(plugins)] extern crate app_units; @@ -52,7 +51,7 @@ extern crate script_traits; extern crate serde; extern crate serde_json; extern crate smallvec; -extern crate string_cache; +#[macro_use(atom, ns)] extern crate string_cache; extern crate style; extern crate unicode_bidi; extern crate unicode_script; diff --git a/components/layout/query.rs b/components/layout/query.rs index cdb0c7da0eb..1a00ffbdb55 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -555,7 +555,7 @@ pub fn process_resolved_style_request(requested_node: ServoLayoutNode, } // FIXME: implement used value computation for line-height ref property => { - style.computed_value_to_string(property.as_slice()).ok() + style.computed_value_to_string(&*property).ok() } } } diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index 5c1622c3295..f76a3ea3862 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -662,7 +662,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> { NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAreaElement)) | NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLinkElement)) => { unsafe { - (*self.element.unsafe_get()).get_attr_val_for_layout(&ns!(""), &atom!("href")).is_some() + (*self.element.unsafe_get()).get_attr_val_for_layout(&ns!(), &atom!("href")).is_some() } } _ => false, @@ -712,7 +712,7 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> { #[inline] fn has_servo_nonzero_border(&self) -> bool { unsafe { - match (*self.element.unsafe_get()).get_attr_for_layout(&ns!(""), &atom!("border")) { + match (*self.element.unsafe_get()).get_attr_for_layout(&ns!(), &atom!("border")) { None | Some(&AttrValue::UInt(_, 0)) => false, _ => true, } |