style: Fix inheritance of animation and transition properties of mismatched length.

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
This commit is contained in:
Emilio Cobos Álvarez 2017-12-21 05:31:26 +01:00
parent 6524d22814
commit 974458cafc
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

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) {