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
This commit is contained in:
Simon Sapin 2016-09-27 15:16:04 +02:00
parent f90b288547
commit 29c72d15a9
12 changed files with 13 additions and 15 deletions

View file

@ -33,7 +33,7 @@ range = {path = "../range"}
rustc-serialize = "0.3" rustc-serialize = "0.3"
script_layout_interface = {path = "../script_layout_interface"} script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}
selectors = {version = "0.13", features = ["heap_size"]} selectors = "0.13"
serde_macros = "0.8" serde_macros = "0.8"
smallvec = "0.1" smallvec = "0.1"
string_cache = {version = "0.2.26", features = ["heap_size"]} string_cache = {version = "0.2.26", features = ["heap_size"]}

View file

@ -62,7 +62,7 @@ regex = "0.1.43"
rustc-serialize = "0.3" rustc-serialize = "0.3"
script_layout_interface = {path = "../script_layout_interface"} script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}
selectors = {version = "0.13", features = ["heap_size"]} selectors = "0.13"
serde = "0.8" serde = "0.8"
smallvec = "0.1" smallvec = "0.1"
string_cache = {version = "0.2.26", features = ["heap_size", "unstable"]} string_cache = {version = "0.2.26", features = ["heap_size", "unstable"]}

View file

@ -27,7 +27,7 @@ plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"} profile_traits = {path = "../profile_traits"}
range = {path = "../range"} range = {path = "../range"}
script_traits = {path = "../script_traits"} script_traits = {path = "../script_traits"}
selectors = {version = "0.13", features = ["heap_size"]} selectors = "0.13"
string_cache = {version = "0.2.26", features = ["heap_size"]} string_cache = {version = "0.2.26", features = ["heap_size"]}
style = {path = "../style"} style = {path = "../style"}
url = {version = "1.2", features = ["heap_size"]} url = {version = "1.2", features = ["heap_size"]}

View file

@ -2119,8 +2119,6 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "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)", "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)", "string_cache 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)",
] ]

View file

@ -16,7 +16,7 @@ gecko = []
servo = ["serde/unstable", "serde", "serde_macros", "heapsize_plugin", servo = ["serde/unstable", "serde", "serde_macros", "heapsize_plugin",
"style_traits/servo", "app_units/plugins", "style_traits/servo", "app_units/plugins",
"cssparser/heap_size", "cssparser/serde-serialization", "cssparser/heap_size", "cssparser/serde-serialization",
"selectors/heap_size", "selectors/unstable", "string_cache", "selectors/unstable", "string_cache",
"url/heap_size", "plugins"] "url/heap_size", "plugins"]
testing = [] testing = []

View file

@ -77,6 +77,7 @@ pub struct Keyframe {
/// so the second value of these tuples is always `Importance::Normal`. /// so the second value of these tuples is always `Importance::Normal`.
/// But including them enables `compute_style_for_animation_step` to create a `ApplicableDeclarationBlock` /// 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<_>`. /// 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>, pub block: Arc<PropertyDeclarationBlock>,
} }

View file

@ -1378,7 +1378,7 @@ pub use gecko_properties::ComputedValues;
pub type ServoComputedValues = ComputedValues; pub type ServoComputedValues = ComputedValues;
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
#[cfg_attr(feature = "servo", derive(Clone, Debug, HeapSizeOf))] #[cfg_attr(feature = "servo", derive(Clone, Debug))]
pub struct ComputedValues { pub struct ComputedValues {
% for style_struct in data.active_style_structs(): % for style_struct in data.active_style_structs():
${style_struct.ident}: Arc<style_structs::${style_struct.name}>, ${style_struct.ident}: Arc<style_structs::${style_struct.name}>,

View file

@ -340,6 +340,7 @@ impl Sensitivities {
#[derive(Debug)] #[derive(Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
struct Dependency { struct Dependency {
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
selector: Arc<ComplexSelector<TheSelectorImpl>>, selector: Arc<ComplexSelector<TheSelectorImpl>>,
hint: RestyleHint, hint: RestyleHint,
sensitivities: Sensitivities, sensitivities: Sensitivities,

View file

@ -78,10 +78,12 @@ pub struct Stylist {
state_deps: DependencySet, state_deps: DependencySet,
/// Selectors in the page affecting siblings /// Selectors in the page affecting siblings
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
sibling_affecting_selectors: Vec<Selector<TheSelectorImpl>>, sibling_affecting_selectors: Vec<Selector<TheSelectorImpl>>,
/// Selectors in the page matching elements with non-common style-affecting /// Selectors in the page matching elements with non-common style-affecting
/// attributes. /// attributes.
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
non_common_style_affecting_attributes_selectors: Vec<Selector<TheSelectorImpl>>, 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 // This is an Arc because Rule will essentially be cloned for every element
// that it matches. Selector contains an owned vector (through // that it matches. Selector contains an owned vector (through
// ComplexSelector) and we want to avoid the allocation. // ComplexSelector) and we want to avoid the allocation.
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
pub selector: Arc<ComplexSelector<TheSelectorImpl>>, pub selector: Arc<ComplexSelector<TheSelectorImpl>>,
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
pub declarations: Arc<PropertyDeclarationBlock>, pub declarations: Arc<PropertyDeclarationBlock>,
pub source_order: usize, pub source_order: usize,
pub specificity: u32, pub specificity: u32,
@ -864,6 +868,7 @@ impl Rule {
pub struct ApplicableDeclarationBlock { pub struct ApplicableDeclarationBlock {
/// Contains declarations of either importance, but only those of self.importance are relevant. /// Contains declarations of either importance, but only those of self.importance are relevant.
/// Use ApplicableDeclarationBlock::iter /// Use ApplicableDeclarationBlock::iter
#[cfg_attr(feature = "servo", ignore_heap_size_of = "Arc")]
pub mixed_declarations: Arc<PropertyDeclarationBlock>, pub mixed_declarations: Arc<PropertyDeclarationBlock>,
pub importance: Importance, pub importance: Importance,
pub source_order: usize, pub source_order: usize,

View file

@ -43,7 +43,6 @@ pub enum Origin {
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct Stylesheet { pub struct Stylesheet {
/// List of rules in the order they were found (important for /// List of rules in the order they were found (important for
/// cascading order) /// cascading order)
@ -63,7 +62,6 @@ pub struct UserAgentStylesheets {
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum CSSRule { pub enum CSSRule {
// No Charset here, CSSCharsetRule has been removed from CSSOM // No Charset here, CSSCharsetRule has been removed from CSSOM
// https://drafts.csswg.org/cssom/#changes-from-5-december-2013 // https://drafts.csswg.org/cssom/#changes-from-5-december-2013
@ -86,14 +84,12 @@ pub struct NamespaceRule {
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct KeyframesRule { pub struct KeyframesRule {
pub name: Atom, pub name: Atom,
pub keyframes: Vec<Arc<Keyframe>>, pub keyframes: Vec<Arc<Keyframe>>,
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct MediaRule { pub struct MediaRule {
pub media_queries: Arc<MediaQueryList>, pub media_queries: Arc<MediaQueryList>,
pub rules: Vec<CSSRule>, pub rules: Vec<CSSRule>,
@ -108,7 +104,6 @@ impl MediaRule {
} }
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct StyleRule { pub struct StyleRule {
pub selectors: Vec<Selector<TheSelectorImpl>>, pub selectors: Vec<Selector<TheSelectorImpl>>,
pub declarations: Arc<PropertyDeclarationBlock>, pub declarations: Arc<PropertyDeclarationBlock>,

2
ports/cef/Cargo.lock generated
View file

@ -1960,8 +1960,6 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "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)", "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)", "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)", "string_cache 0.2.29 (registry+https://github.com/rust-lang/crates.io-index)",
] ]

View file

@ -14,7 +14,7 @@ app_units = "0.3"
cssparser = {version = "0.7", features = ["heap_size"]} cssparser = {version = "0.7", features = ["heap_size"]}
euclid = "0.10.1" euclid = "0.10.1"
rustc-serialize = "0.3" rustc-serialize = "0.3"
selectors = {version = "0.13", features = ["heap_size"]} selectors = "0.13"
string_cache = {version = "0.2.26", features = ["heap_size"]} string_cache = {version = "0.2.26", features = ["heap_size"]}
style = {path = "../../../components/style"} style = {path = "../../../components/style"}
style_traits = {path = "../../../components/style_traits"} style_traits = {path = "../../../components/style_traits"}