mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #19617 - emilio:inherit-animation-stuff, r=hiro
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 <!-- 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/19617) <!-- Reviewable:end -->
This commit is contained in:
commit
9a4a2b07aa
1 changed files with 7 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue