From 05f7cea25fbc42b372c176cb4c71364d355effc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Sun, 6 Aug 2017 22:34:56 -0700 Subject: [PATCH 1/2] Fix file paths in comments --- components/style/values/computed/length.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index 29117a5cb8d..4d9f0cd6fbc 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -574,7 +574,7 @@ impl LengthOrNumber { pub type LengthOrNormal = Either; /// A value suitable for a `min-width`, `min-height`, `width` or `height` property. -/// See specified/values/length.rs for more details. +/// See values/specified/length.rs for more details. #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Copy, Debug, PartialEq, ToCss)] @@ -618,7 +618,7 @@ impl ToComputedValue for specified::MozLength { } /// A value suitable for a `max-width` or `max-height` property. -/// See specified/values/length.rs for more details. +/// See values/specified/length.rs for more details. #[allow(missing_docs)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Copy, Debug, PartialEq, ToCss)] From 41698e7923a4a10e3f0886e5761923591c2f3364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Sun, 6 Aug 2017 22:35:22 -0700 Subject: [PATCH 2/2] Implement ToAnimatedZero for MozLength --- .../style/properties/helpers/animated_properties.mako.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 4419e2921fe..d6e20b26cce 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -1364,7 +1364,14 @@ impl Animatable for MozLength { impl ToAnimatedZero for MozLength { #[inline] - fn to_animated_zero(&self) -> Result { Err(()) } + fn to_animated_zero(&self) -> Result { + match *self { + MozLength::LengthOrPercentageOrAuto(ref length) => { + Ok(MozLength::LengthOrPercentageOrAuto(length.to_animated_zero()?)) + }, + _ => Err(()) + } + } } /// https://drafts.csswg.org/css-transitions/#animtype-lpcalc