From 318d8696e5c360d648bd9a4d87e9cd1055f63ed4 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 26 Aug 2017 16:29:09 +0200 Subject: [PATCH] Derive Animate and ComputeSquaredDistance for computed font-size-adjust --- .../style/properties/longhand/font.mako.rs | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index 51c2e38181c..7dc51dca3d4 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -1116,12 +1116,12 @@ ${helpers.single_keyword_system("font-variant-caps", pub mod computed_value { use values::CSSFloat; - use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; - use values::distance::{ComputeSquaredDistance, SquaredDistance}; + use values::animated::{ToAnimatedValue, ToAnimatedZero}; #[cfg_attr(feature = "servo", derive(HeapSizeOf))] - #[derive(Clone, Copy, Debug, PartialEq, ToCss)] + #[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, PartialEq, ToCss)] pub enum T { + #[animation(error)] None, Number(CSSFloat), } @@ -1136,27 +1136,6 @@ ${helpers.single_keyword_system("font-variant-caps", } } - impl Animate for T { - fn animate(&self, other: &Self, procedure: Procedure) -> Result { - match (self, other) { - (&T::Number(ref number), &T::Number(ref other)) => { - Ok(T::Number(number.animate(other, procedure)?)) - }, - _ => Err(()), - } - } - } - - impl ComputeSquaredDistance for T { - #[inline] - fn compute_squared_distance(&self, other: &Self) -> Result { - match (self, other) { - (&T::Number(ref this), &T::Number(ref other)) => this.compute_squared_distance(other), - _ => Err(()), - } - } - } - impl ToAnimatedZero for T { #[inline] fn to_animated_zero(&self) -> Result { Err(()) }