diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2016-09-27 15:16:04 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2016-10-04 13:45:57 +0200 |
commit | 29c72d15a943386ee2f3130fbe741b0457cb52e5 (patch) | |
tree | 5f157eafd46e79cc297aa59610c7deaff2fda167 | |
parent | f90b2885473b61df2067fcfd9f4f7efa13b3d1cf (diff) | |
download | servo-29c72d15a943386ee2f3130fbe741b0457cb52e5.tar.gz servo-29c72d15a943386ee2f3130fbe741b0457cb52e5.zip |
Make style build without `impl<T: HeapSizeOf> HeapSizeOf for Arc<T>`.
The removal of this impl is not included in this commit.
CC https://github.com/servo/heapsize/issues/37#issuecomment-249861171
-rw-r--r-- | components/layout/Cargo.toml | 2 | ||||
-rw-r--r-- | components/script/Cargo.toml | 2 | ||||
-rw-r--r-- | components/script_layout_interface/Cargo.toml | 2 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 2 | ||||
-rw-r--r-- | components/style/Cargo.toml | 2 | ||||
-rw-r--r-- | components/style/keyframes.rs | 1 | ||||
-rw-r--r-- | components/style/properties/properties.mako.rs | 2 | ||||
-rw-r--r-- | components/style/restyle_hints.rs | 1 | ||||
-rw-r--r-- | components/style/selector_matching.rs | 5 | ||||
-rw-r--r-- | components/style/stylesheets.rs | 5 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 2 | ||||
-rw-r--r-- | tests/unit/style/Cargo.toml | 2 |
12 files changed, 13 insertions, 15 deletions
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index 68289ce2203..b7007219e7d 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -33,7 +33,7 @@ range = {path = "../range"} rustc-serialize = "0.3" script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} -selectors = {version = "0.13", features = ["heap_size"]} +selectors = "0.13" serde_macros = "0.8" smallvec = "0.1" string_cache = {version = "0.2.26", features = ["heap_size"]} diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 626eb4e2288..00d013c3080 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -62,7 +62,7 @@ regex = "0.1.43" rustc-serialize = "0.3" script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} -selectors = {version = "0.13", features = ["heap_size"]} +selectors = "0.13" serde = "0.8" smallvec = "0.1" string_cache = {version = "0.2.26", features = ["heap_size", "unstable"]} diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml index 18c90e2cf59..970c74aa515 100644 --- a/components/script_layout_interface/Cargo.toml +++ b/components/script_layout_interface/Cargo.toml @@ -27,7 +27,7 @@ plugins = {path = "../plugins"} profile_traits = {path = "../profile_traits"} range = {path = "../range"} script_traits = {path = "../script_traits"} -selectors = {version = "0.13", features = ["heap_size"]} +selectors = "0.13" string_cache = {version = "0.2.26", features = ["heap_size"]} style = {path = "../style"} url = {version = "1.2", features = ["heap_size"]} diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 2fb1750ac59..c47d573580d 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -2119,8 +2119,6 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize_plugin 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 358df77ff8c..db30ca2a3ab 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -16,7 +16,7 @@ gecko = [] servo = ["serde/unstable", "serde", "serde_macros", "heapsize_plugin", "style_traits/servo", "app_units/plugins", "cssparser/heap_size", "cssparser/serde-serialization", - "selectors/heap_size", "selectors/unstable", "string_cache", + "selectors/unstable", "string_cache", "url/heap_size", "plugins"] testing = [] diff --git a/components/style/keyframes.rs b/components/style/keyframes.rs index 01043b0fc5e..69d783fa57f 100644 --- a/components/style/keyframes.rs +++ b/components/style/keyframes.rs @@ -77,6 +77,7 @@ pub struct Keyframe { /// so the second value of these tuples is always `Importance::Normal`. /// But including them enables `compute_style_for_animation_step` to create a `ApplicableDeclarationBlock` /// by cloning an `Arc<_>` (incrementing a reference count) rather than re-creating a `Vec<_>`. + #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] pub block: Arc<PropertyDeclarationBlock>, } diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index e55d3d1c06d..ead84567e45 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1378,7 +1378,7 @@ pub use gecko_properties::ComputedValues; pub type ServoComputedValues = ComputedValues; #[cfg(feature = "servo")] -#[cfg_attr(feature = "servo", derive(Clone, Debug, HeapSizeOf))] +#[cfg_attr(feature = "servo", derive(Clone, Debug))] pub struct ComputedValues { % for style_struct in data.active_style_structs(): ${style_struct.ident}: Arc<style_structs::${style_struct.name}>, diff --git a/components/style/restyle_hints.rs b/components/style/restyle_hints.rs index 1471f451843..b47180b60a9 100644 --- a/components/style/restyle_hints.rs +++ b/components/style/restyle_hints.rs @@ -340,6 +340,7 @@ impl Sensitivities { #[derive(Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] struct Dependency { + #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] selector: Arc<ComplexSelector<TheSelectorImpl>>, hint: RestyleHint, sensitivities: Sensitivities, diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs index 292b6cc7d9c..fa7654251d9 100644 --- a/components/style/selector_matching.rs +++ b/components/style/selector_matching.rs @@ -78,10 +78,12 @@ pub struct Stylist { state_deps: DependencySet, /// Selectors in the page affecting siblings + #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] sibling_affecting_selectors: Vec<Selector<TheSelectorImpl>>, /// Selectors in the page matching elements with non-common style-affecting /// attributes. + #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] non_common_style_affecting_attributes_selectors: Vec<Selector<TheSelectorImpl>>, } @@ -839,7 +841,9 @@ pub struct Rule { // This is an Arc because Rule will essentially be cloned for every element // that it matches. Selector contains an owned vector (through // ComplexSelector) and we want to avoid the allocation. + #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] pub selector: Arc<ComplexSelector<TheSelectorImpl>>, + #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] pub declarations: Arc<PropertyDeclarationBlock>, pub source_order: usize, pub specificity: u32, @@ -864,6 +868,7 @@ impl Rule { pub struct ApplicableDeclarationBlock { /// Contains declarations of either importance, but only those of self.importance are relevant. /// Use ApplicableDeclarationBlock::iter + #[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")] pub mixed_declarations: Arc<PropertyDeclarationBlock>, pub importance: Importance, pub source_order: usize, diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs index 56bd8e88944..c9186dde04c 100644 --- a/components/style/stylesheets.rs +++ b/components/style/stylesheets.rs @@ -43,7 +43,6 @@ pub enum Origin { #[derive(Debug, PartialEq)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct Stylesheet { /// List of rules in the order they were found (important for /// cascading order) @@ -63,7 +62,6 @@ pub struct UserAgentStylesheets { #[derive(Debug, PartialEq)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum CSSRule { // No Charset here, CSSCharsetRule has been removed from CSSOM // https://drafts.csswg.org/cssom/#changes-from-5-december-2013 @@ -86,14 +84,12 @@ pub struct NamespaceRule { } #[derive(Debug, PartialEq)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct KeyframesRule { pub name: Atom, pub keyframes: Vec<Arc<Keyframe>>, } #[derive(Debug, PartialEq)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct MediaRule { pub media_queries: Arc<MediaQueryList>, pub rules: Vec<CSSRule>, @@ -108,7 +104,6 @@ impl MediaRule { } #[derive(Debug, PartialEq)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct StyleRule { pub selectors: Vec<Selector<TheSelectorImpl>>, pub declarations: Arc<PropertyDeclarationBlock>, diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 808cfd99149..6a07de58904 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -1960,8 +1960,6 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize_plugin 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml index a7923a49a69..94543b52a69 100644 --- a/tests/unit/style/Cargo.toml +++ b/tests/unit/style/Cargo.toml @@ -14,7 +14,7 @@ app_units = "0.3" cssparser = {version = "0.7", features = ["heap_size"]} euclid = "0.10.1" rustc-serialize = "0.3" -selectors = {version = "0.13", features = ["heap_size"]} +selectors = "0.13" string_cache = {version = "0.2.26", features = ["heap_size"]} style = {path = "../../../components/style"} style_traits = {path = "../../../components/style_traits"} |