From 3150a92651a4f9d1fd13f8fa48d0c877db961484 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 7 Apr 2017 16:44:38 +1000 Subject: [PATCH] Remove servo_url dependency for geckolib It seems mod attr is not used for geckolib at all, and that is the only place where servo_url is still referenced for geckolib, so we can just remove it. --- components/style/Cargo.toml | 4 ++-- components/style/attr.rs | 4 +--- components/style/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 137328c07079..be0d5fb5d946 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -18,7 +18,7 @@ use_bindgen = ["bindgen", "regex"] servo = ["serde/unstable", "serde", "serde_derive", "heapsize", "heapsize_derive", "style_traits/servo", "servo_atoms", "html5ever-atoms", "cssparser/heapsize", "cssparser/serde", "encoding", - "rayon/unstable", "servo_url/servo"] + "rayon/unstable", "servo_url", "servo_url/servo"] testing = [] [dependencies] @@ -52,7 +52,7 @@ servo_atoms = {path = "../atoms", optional = true} servo_config = {path = "../config"} smallvec = "0.3" style_traits = {path = "../style_traits"} -servo_url = {path = "../url"} +servo_url = {path = "../url", optional = true} time = "0.1" unicode-segmentation = "1.0" diff --git a/components/style/attr.rs b/components/style/attr.rs index b4cd434635e7..90154c151c79 100644 --- a/components/style/attr.rs +++ b/components/style/attr.rs @@ -19,7 +19,7 @@ use std::str::FromStr; use std::sync::Arc; use str::{HTML_SPACE_CHARACTERS, read_exponent, read_fraction}; use str::{read_numbers, split_commas, split_html_space_chars}; -#[cfg(not(feature = "gecko"))] use str::str_join; +use str::str_join; use values::specified::Length; // Duplicated from script::dom::values. @@ -166,7 +166,6 @@ impl AttrValue { AttrValue::TokenList(tokens, atoms) } - #[cfg(not(feature = "gecko"))] // Gecko can't borrow atoms as UTF-8. pub fn from_atomic_tokens(atoms: Vec) -> AttrValue { // TODO(ajeffrey): effecient conversion of Vec to String let tokens = String::from(str_join(&atoms, "\x20")); @@ -335,7 +334,6 @@ impl AttrValue { } } -#[cfg(not(feature = "gecko"))] // Gecko can't borrow atoms as UTF-8. impl ::std::ops::Deref for AttrValue { type Target = str; diff --git a/components/style/lib.rs b/components/style/lib.rs index bdd7057f4a5d..d11deca488b4 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -71,7 +71,7 @@ extern crate selectors; #[cfg(feature = "servo")] #[macro_use] extern crate serde_derive; #[cfg(feature = "servo")] #[macro_use] extern crate servo_atoms; extern crate servo_config; -extern crate servo_url; +#[cfg(feature = "servo")] extern crate servo_url; extern crate smallvec; #[macro_use] extern crate style_traits; @@ -81,7 +81,7 @@ extern crate unicode_segmentation; pub mod animation; #[allow(missing_docs)] // TODO. -pub mod attr; +#[cfg(feature = "servo")] pub mod attr; pub mod bezier; pub mod bloom; pub mod cache;