servo: Merge #19617 - style: Fix inheritance of animation and transition properties of mismatched length (from emilio:inherit-animation-stuff); r=hiro

At least when the animation-name length is bigger than the animation properties,
we mess up inheritance and only set properly the specified counts, then don't
cycle it.

The nicer fix for this is making these vectors properly, and move the cycling
logic at used-value time (bug 1420928). Same for transitions.

Bug: 1426246
Reviewed-by: hiro
MozReview-Commit-ID: 3cguzIvfMFU
Source-Repo: https://github.com/servo/servo
Source-Revision: 9a4a2b07aa15efe3c41debb3ec199557694c4d62

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : dceaa7f7ba61fc5fcbc998f14ec4950bdab055ba
This commit is contained in:
Emilio Cobos Álvarez 2017-12-21 00:10:49 -06:00
parent 65122eed20
commit 77db25b297

View File

@ -2951,10 +2951,12 @@ fn static_assert() {
let count = other.gecko.m${type.capitalize()}${gecko_ffi_name}Count;
self.gecko.m${type.capitalize()}${gecko_ffi_name}Count = count;
// The length of mTransitions or mAnimations is often greater than m{Transition|Animation}XXCount,
// don't copy values over the count.
for (index, gecko) in self.gecko.m${type.capitalize()}s.iter_mut().enumerate().take(count as usize) {
gecko.m${gecko_ffi_name} = other.gecko.m${type.capitalize()}s[index].m${gecko_ffi_name};
let iter = self.gecko.m${type.capitalize()}s.iter_mut().zip(
other.gecko.m${type.capitalize()}s.iter().take(count as usize).cycle()
);
for (ours, others) in iter {
ours.m${gecko_ffi_name} = others.m${gecko_ffi_name};
}
}
@ -3734,6 +3736,7 @@ fn static_assert() {
count as usize,
LayerType::${shorthand.title()});
}
// FIXME(emilio): This may be bogus in the same way as bug 1426246.
for (layer, other) in self.gecko.${layers_field_name}.mLayers.iter_mut()
.zip(other.gecko.${layers_field_name}.mLayers.iter())
.take(count as usize) {