diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 4fb05ac1c18..be4aa518fd8 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -34,7 +34,6 @@ use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone use values::computed::{BorderRadiusSize, ClipRect, LengthOrNone}; use values::computed::{CalcLengthOrPercentage, Context, LengthOrPercentage}; use values::computed::{MaxLength, MinLength}; -use values::computed::ColorOrAuto; use values::computed::position::{HorizontalPosition, Position, VerticalPosition}; use values::computed::ToComputedValue; use values::specified::Angle as SpecifiedAngle; @@ -399,6 +398,13 @@ impl Interpolate for Au { } } +impl Interpolate for Auto { + #[inline] + fn interpolate(&self, _other: &Self, _progress: f64) -> Result { + Ok(Auto) + } +} + impl Interpolate for Option where T: Interpolate, { @@ -1832,16 +1838,17 @@ impl Interpolate for TransformList { } } -/// https://drafts.csswg.org/css-transitions-1/#animtype-color -impl Interpolate for ColorOrAuto { +impl Interpolate for Either + where T: Interpolate + Copy, U: Interpolate + Copy, +{ #[inline] fn interpolate(&self, other: &Self, progress: f64) -> Result { match (*self, *other) { (Either::First(ref this), Either::First(ref other)) => { this.interpolate(&other, progress).map(Either::First) }, - (Either::Second(Auto), Either::Second(Auto)) => { - Ok(Either::Second(Auto)) + (Either::Second(ref this), Either::Second(ref other)) => { + this.interpolate(&other, progress).map(Either::Second) }, _ => { let interpolated = if progress < 0.5 { *self } else { *other };