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 /components/style/keyframes.rs | |
parent | bb916bb38bc4298477bfc8134b94dc906054bce1 (diff) | |
download | servo-2d52b13f2fa08a0b9cc052de7b9c8b155c603d65.tar.gz servo-2d52b13f2fa08a0b9cc052de7b9c8b155c603d65.zip |
Make geckolib possible to build on stable Rust
Diffstat (limited to 'components/style/keyframes.rs')
-rw-r--r-- | components/style/keyframes.rs | 18 |
1 files changed, 12 insertions, 6 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. |