Auto merge of #16527 - BorisChiou:stylo/transition/shorthands, r=emilio

stylo: Bug 1353628 - Support shorthand properties for CSS Transition.

These patches add shorthand properties into TransitionProperty, so we can parse the shorthand properties properly and create transitions for them.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1353628
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16527)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-19 07:35:09 -05:00 committed by GitHub
commit 355d5f89da
8 changed files with 150 additions and 25 deletions

View file

@ -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);