diff --git a/components/style/values/animated/mod.rs b/components/style/values/animated/mod.rs index bcb6dc46954..5946168f52f 100644 --- a/components/style/values/animated/mod.rs +++ b/components/style/values/animated/mod.rs @@ -15,7 +15,6 @@ use values::computed::Angle as ComputedAngle; use values::computed::BorderCornerRadius as ComputedBorderCornerRadius; #[cfg(feature = "servo")] use values::computed::ComputedUrl; -use values::computed::GreaterThanOrEqualToOneNumber as ComputedGreaterThanOrEqualToOneNumber; use values::computed::MaxLength as ComputedMaxLength; use values::computed::MozLength as ComputedMozLength; use values::computed::NonNegativeLength as ComputedNonNegativeLength; @@ -262,20 +261,6 @@ trivial_to_animated_value!(ComputedUrl); trivial_to_animated_value!(bool); trivial_to_animated_value!(f32); -impl ToAnimatedValue for ComputedGreaterThanOrEqualToOneNumber { - type AnimatedValue = Self; - - #[inline] - fn to_animated_value(self) -> Self { - self - } - - #[inline] - fn from_animated_value(animated: Self::AnimatedValue) -> Self { - animated.0.max(1.).into() - } -} - impl ToAnimatedValue for ComputedNonNegativeLength { type AnimatedValue = Self; diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index dca7354e3bf..14548efc909 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -460,6 +460,20 @@ impl From for CSSFloat { /// A wrapper of Number, but the value >= 1. pub type GreaterThanOrEqualToOneNumber = GreaterThanOrEqualToOne; +impl ToAnimatedValue for GreaterThanOrEqualToOneNumber { + type AnimatedValue = CSSFloat; + + #[inline] + fn to_animated_value(self) -> Self::AnimatedValue { + self.0 + } + + #[inline] + fn from_animated_value(animated: Self::AnimatedValue) -> Self { + animated.max(1.).into() + } +} + impl From for GreaterThanOrEqualToOneNumber { #[inline] fn from(number: CSSFloat) -> GreaterThanOrEqualToOneNumber { diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs index bd97bd780d4..5de5e450cb6 100644 --- a/components/style/values/computed/text.rs +++ b/components/style/values/computed/text.rs @@ -9,7 +9,6 @@ use properties::StyleBuilder; use std::fmt::{self, Write}; use style_traits::{CssWriter, ToCss}; use values::{CSSInteger, CSSFloat}; -use values::animated::ToAnimatedZero; use values::computed::{NonNegativeLength, NonNegativeNumber}; use values::computed::length::{Length, LengthOrPercentage}; use values::generics::text::InitialLetter as GenericInitialLetter; @@ -31,11 +30,6 @@ pub type WordSpacing = Spacing; /// A computed value for the `line-height` property. pub type LineHeight = GenericLineHeight; -impl ToAnimatedZero for LineHeight { - #[inline] - fn to_animated_zero(&self) -> Result { Err(()) } -} - #[derive(Clone, Debug, MallocSizeOf, PartialEq)] /// text-overflow. /// When the specified value only has one side, that's the "second" diff --git a/components/style/values/generics/text.rs b/components/style/values/generics/text.rs index 4ff582f811f..94955a58b02 100644 --- a/components/style/values/generics/text.rs +++ b/components/style/values/generics/text.rs @@ -121,6 +121,11 @@ pub enum LineHeight { Length(LengthOrPercentage), } +impl ToAnimatedZero for LineHeight { + #[inline] + fn to_animated_zero(&self) -> Result { Err(()) } +} + impl LineHeight { /// Returns `normal`. #[inline]