Check interpolatable to tell whether transition is created or not.

This commit is contained in:
Hiroyuki Ikezoe 2017-08-15 13:03:17 +09:00
parent 4771e6ea1e
commit f6b8fb177c

View file

@ -1396,6 +1396,8 @@ impl<'le> TElement for GeckoElement<'le> {
existing_transitions: &HashMap<TransitionProperty,
Arc<AnimationValue>>)
-> 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]