diff options
author | Boris Chiou <boris.chiou@gmail.com> | 2017-04-19 10:44:30 +0800 |
---|---|---|
committer | Boris Chiou <boris.chiou@gmail.com> | 2017-04-19 17:42:44 +0800 |
commit | 43f9f8ca957a41f0e4dada0c33bf15d870be50a9 (patch) | |
tree | 0c1a904356a740ed676880c2c0e04fb63f5671d9 /components/style/animation.rs | |
parent | 3a1421491b8eafc893d69a6d0758bec69d823507 (diff) | |
download | servo-43f9f8ca957a41f0e4dada0c33bf15d870be50a9.tar.gz servo-43f9f8ca957a41f0e4dada0c33bf15d870be50a9.zip |
Bug 1353628 - Part 3: Create PropertyAnimation for shorthands.
Therefore, we can start transitions on shorthand properties properly.
MozReview-Commit-ID: Ev2u2tEalnK
Diffstat (limited to 'components/style/animation.rs')
-rw-r--r-- | components/style/animation.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/components/style/animation.rs b/components/style/animation.rs index aeff683f407..63998083d6d 100644 --- a/components/style/animation.rs +++ b/components/style/animation.rs @@ -272,6 +272,15 @@ impl PropertyAnimation { let timing_function = box_style.transition_timing_function_mod(transition_index); let duration = box_style.transition_duration_mod(transition_index); + if transition_property.is_shorthand() { + return transition_property.longhands().iter().filter_map(|transition_property| { + PropertyAnimation::from_transition_property(*transition_property, + timing_function, + duration, + old_style, + new_style) + }).collect(); + } if transition_property != TransitionProperty::All { if let Some(property_animation) = @@ -305,6 +314,8 @@ impl PropertyAnimation { 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, old_style, new_style); |