diff options
Diffstat (limited to 'components/style/animation.rs')
-rw-r--r-- | components/style/animation.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/components/style/animation.rs b/components/style/animation.rs index 2229d485591..16c7dab364d 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -272,9 +272,13 @@ impl PropertyAnimation { let timing_function = box_style.transition_timing_function_mod(transition_index); let duration = box_style.transition_duration_mod(transition_index); + if let TransitionProperty::Unsupported(_) = transition_property { + return result + } + if transition_property.is_shorthand() { return transition_property.longhands().iter().filter_map(|transition_property| { - PropertyAnimation::from_transition_property(*transition_property, + PropertyAnimation::from_transition_property(transition_property, timing_function, duration, old_style, @@ -284,7 +288,7 @@ impl PropertyAnimation { if transition_property != TransitionProperty::All { if let Some(property_animation) = - PropertyAnimation::from_transition_property(transition_property, + PropertyAnimation::from_transition_property(&transition_property, timing_function, duration, old_style, @@ -296,7 +300,7 @@ impl PropertyAnimation { TransitionProperty::each(|transition_property| { if let Some(property_animation) = - PropertyAnimation::from_transition_property(transition_property, + PropertyAnimation::from_transition_property(&transition_property, timing_function, duration, old_style, @@ -308,15 +312,15 @@ impl PropertyAnimation { result } - fn from_transition_property(transition_property: TransitionProperty, + fn from_transition_property(transition_property: &TransitionProperty, timing_function: TransitionTimingFunction, duration: Time, old_style: &ComputedValues, new_style: &ComputedValues) -> Option<PropertyAnimation> { debug_assert!(!transition_property.is_shorthand() && - transition_property != TransitionProperty::All); - let animated_property = AnimatedProperty::from_transition_property(&transition_property, + transition_property != &TransitionProperty::All); + let animated_property = AnimatedProperty::from_transition_property(transition_property, old_style, new_style); @@ -702,7 +706,7 @@ pub fn update_style_for_animation(context: &SharedStyleContext, for transition_property in &animation.properties_changed { debug!("update_style_for_animation: scanning prop {:?} for animation \"{}\"", transition_property, name); - match PropertyAnimation::from_transition_property(*transition_property, + match PropertyAnimation::from_transition_property(transition_property, timing_function, Time::from_seconds(relative_duration as f32), &from_style, |