diff --git a/components/style/values/computed/background.rs b/components/style/values/computed/background.rs index 82b6ba74f28..f3180c54ebe 100644 --- a/components/style/values/computed/background.rs +++ b/components/style/values/computed/background.rs @@ -6,7 +6,7 @@ use properties::animated_properties::RepeatableListAnimatable; use properties::longhands::background_size::computed_value::T as BackgroundSizeList; -use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; +use values::animated::{ToAnimatedValue, ToAnimatedZero}; use values::computed::length::LengthOrPercentageOrAuto; use values::generics::background::BackgroundSize as GenericBackgroundSize; @@ -15,23 +15,6 @@ pub type BackgroundSize = GenericBackgroundSize; impl RepeatableListAnimatable for BackgroundSize {} -impl Animate for BackgroundSize { - fn animate(&self, other: &Self, procedure: Procedure) -> Result { - match (self, other) { - ( - &GenericBackgroundSize::Explicit { width: self_width, height: self_height }, - &GenericBackgroundSize::Explicit { width: other_width, height: other_height }, - ) => { - Ok(GenericBackgroundSize::Explicit { - width: self_width.animate(&other_width, procedure)?, - height: self_height.animate(&other_height, procedure)?, - }) - } - _ => Err(()), - } - } -} - impl ToAnimatedZero for BackgroundSize { #[inline] fn to_animated_zero(&self) -> Result { Err(()) } diff --git a/components/style/values/generics/background.rs b/components/style/values/generics/background.rs index 8a79691f3b9..abcfb655eec 100644 --- a/components/style/values/generics/background.rs +++ b/components/style/values/generics/background.rs @@ -5,8 +5,9 @@ //! Generic types for CSS values related to backgrounds. /// A generic value for the `background-size` property. -#[derive(Clone, ComputeSquaredDistance, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue, ToCss)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug)] +#[derive(HasViewportPercentage, PartialEq, ToComputedValue, ToCss)] pub enum BackgroundSize { /// ` ` Explicit { @@ -16,8 +17,10 @@ pub enum BackgroundSize { height: LengthOrPercentageOrAuto }, /// `cover` + #[animation(error)] Cover, /// `contain` + #[animation(error)] Contain, }