From f6b8fb177c30a355b9ef64e3a30bc3bef71157ef Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Tue, 15 Aug 2017 13:03:17 +0900 Subject: [PATCH] Check interpolatable to tell whether transition is created or not. --- components/style/gecko/wrapper.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index bb079321bf5..80ab02ae518 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1396,6 +1396,8 @@ impl<'le> TElement for GeckoElement<'le> { existing_transitions: &HashMap>) -> bool { + use properties::animated_properties::Animatable; + // |property| should be an animatable longhand let animatable_longhand = AnimatableLonghand::from_transition_property(property).unwrap(); @@ -1414,7 +1416,9 @@ impl<'le> TElement for GeckoElement<'le> { let to = AnimationValue::from_computed_values(&animatable_longhand, after_change_style); - combined_duration > 0.0f32 && from != to + combined_duration > 0.0f32 && + from != to && + from.interpolate(&to, 0.5).is_ok() } #[inline]