diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2016-07-05 14:53:37 +0200 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2016-07-05 15:37:16 +0200 |
commit | 2d52b13f2fa08a0b9cc052de7b9c8b155c603d65 (patch) | |
tree | ebd6ca2394118294d4fc0c49cfc3114856bc66b7 | |
parent | bb916bb38bc4298477bfc8134b94dc906054bce1 (diff) | |
download | servo-2d52b13f2fa08a0b9cc052de7b9c8b155c603d65.tar.gz servo-2d52b13f2fa08a0b9cc052de7b9c8b155c603d65.zip |
Make geckolib possible to build on stable Rust
-rw-r--r-- | components/style/keyframes.rs | 18 | ||||
-rw-r--r-- | components/style/properties/helpers.mako.rs | 3 | ||||
-rw-r--r-- | components/style/properties/helpers/animated_properties.mako.rs | 6 | ||||
-rw-r--r-- | components/style/properties/longhand/box.mako.rs | 9 | ||||
-rw-r--r-- | components/style/stylesheets.rs | 3 | ||||
-rw-r--r-- | ports/geckolib/Cargo.toml | 3 |
6 files changed, 28 insertions, 14 deletions
diff --git a/components/style/keyframes.rs b/components/style/keyframes.rs index 7d219758848..82dc4c9200f 100644 --- a/components/style/keyframes.rs +++ b/components/style/keyframes.rs @@ -10,7 +10,8 @@ use std::sync::Arc; /// A number from 1 to 100, indicating the percentage of the animation where /// this keyframe should run. -#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, HeapSizeOf)] +#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct KeyframePercentage(pub f32); impl ::std::cmp::Ord for KeyframePercentage { @@ -49,7 +50,8 @@ impl KeyframePercentage { /// A keyframes selector is a list of percentages or from/to symbols, which are /// converted at parse time to percentages. -#[derive(Debug, Clone, PartialEq, HeapSizeOf)] +#[derive(Debug, Clone, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct KeyframeSelector(Vec<KeyframePercentage>); impl KeyframeSelector { #[inline] @@ -64,7 +66,8 @@ impl KeyframeSelector { } /// A keyframe. -#[derive(Debug, Clone, PartialEq, HeapSizeOf)] +#[derive(Debug, Clone, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct Keyframe { pub selector: KeyframeSelector, pub declarations: Arc<Vec<PropertyDeclaration>>, @@ -95,14 +98,16 @@ impl Keyframe { /// is, one autogenerated from the current computed values, or a list of /// declarations to apply. // TODO: Find a better name for this? -#[derive(Debug, Clone, PartialEq, HeapSizeOf)] +#[derive(Debug, Clone, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum KeyframesStepValue { Declarations(Arc<Vec<PropertyDeclaration>>), ComputedValues, } /// A single step from a keyframe animation. -#[derive(Debug, Clone, PartialEq, HeapSizeOf)] +#[derive(Debug, Clone, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct KeyframesStep { /// The percentage of the animation duration when this step starts. pub start_percentage: KeyframePercentage, @@ -126,7 +131,8 @@ impl KeyframesStep { /// of keyframes, in order. /// /// It only takes into account animable properties. -#[derive(Debug, Clone, PartialEq, HeapSizeOf)] +#[derive(Debug, Clone, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct KeyframesAnimation { pub steps: Vec<KeyframesStep>, /// The properties that change in this animation. diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index cd85567c856..81dff023605 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -206,7 +206,8 @@ use cssparser::ToCss; use std::fmt; - #[derive(Debug, Clone, PartialEq, HeapSizeOf)] + #[derive(Debug, Clone, PartialEq)] + #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct T(pub Vec<${to_camel_case(name)}>); impl ToCss for T { diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 504a72cf498..404698968b8 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -34,7 +34,8 @@ use values::computed::{CalcLengthOrPercentage, LengthOrPercentage}; // NB: This needs to be here because it needs all the longhands generated // beforehand. -#[derive(Copy, Clone, Debug, PartialEq, HeapSizeOf)] +#[derive(Copy, Clone, Debug, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum TransitionProperty { All, % for prop in data.longhands: @@ -92,7 +93,8 @@ impl ToCss for TransitionProperty { } } -#[derive(Clone, Debug, PartialEq, HeapSizeOf)] +#[derive(Clone, Debug, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum AnimatedProperty { % for prop in data.longhands: % if prop.animatable: diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index d9195d00df2..580926889be 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -618,7 +618,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", pub use string_cache::Atom as SingleComputedValue; - #[derive(Debug, Clone, PartialEq, HeapSizeOf)] + #[derive(Debug, Clone, PartialEq)] + #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct T(pub Vec<Atom>); impl ToCss for T { @@ -683,7 +684,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", pub use self::AnimationIterationCount as SingleComputedValue; - #[derive(Debug, Clone, PartialEq, HeapSizeOf)] + #[derive(Debug, Clone, PartialEq)] + #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum AnimationIterationCount { Number(u32), Infinite, @@ -698,7 +700,8 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", } } - #[derive(Debug, Clone, PartialEq, HeapSizeOf)] + #[derive(Debug, Clone, PartialEq)] + #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct T(pub Vec<AnimationIterationCount>); impl ToCss for T { diff --git a/components/style/stylesheets.rs b/components/style/stylesheets.rs index 5307f226f4b..d371bf4144f 100644 --- a/components/style/stylesheets.rs +++ b/components/style/stylesheets.rs @@ -67,7 +67,8 @@ pub enum CSSRule<Impl: SelectorImpl> { } -#[derive(Debug, HeapSizeOf, PartialEq)] +#[derive(Debug, PartialEq)] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub struct KeyframesRule { pub name: Atom, pub keyframes: Vec<Keyframe>, diff --git a/ports/geckolib/Cargo.toml b/ports/geckolib/Cargo.toml index e4ee43f7e30..6ca0d6d4e2e 100644 --- a/ports/geckolib/Cargo.toml +++ b/ports/geckolib/Cargo.toml @@ -18,6 +18,7 @@ default = ["servo_features"] # recompiled when building both Servo and geckolib in the same source tree. servo_features = [ "heapsize", + "selectors/unstable", "style/servo", "time", "url/query_encoding", @@ -36,7 +37,7 @@ lazy_static = "0.2" libc = "0.2" log = {version = "0.3.5", features = ["release_max_level_info"]} num_cpus = "0.2.2" -selectors = {version = "0.6", features = ["unstable"]} +selectors = "0.6" smallvec = "0.1" string_cache = {version = "0.2.20", features = ["unstable"]} style = {path = "../../components/style", features = ["gecko"]} |