Skip to content

Commit

Permalink
Check interpolatable to tell whether transition is created or not.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroyuki Ikezoe committed Aug 15, 2017
1 parent 4771e6e commit f6b8fb1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/style/gecko/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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]
Expand Down

0 comments on commit f6b8fb1

Please sign in to comment.