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"
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"]}

View file

@ -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"]}

View file

@ -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"]}

View file

@ -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)",
]

View file

@ -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 = []

View file

@ -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>,
}

View file

@ -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}>,

View file

@ -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,

View file

@ -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,

View file

@ -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>,

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)",
"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)",
]

View file

@ -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"}