mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 847287 patch 13 - Apply animations/transitions on the layer in the order that reflects how they override, rather than the opposite. r=birtles
This independently would have fixed some of the problems fixed in this bug. It would not have fixed them fully, though, since it would not have prevented us from sending animations being covered up by !important rules to the compositor.
This commit is contained in:
parent
1fe6a61ae9
commit
e90b72b9db
@ -1108,6 +1108,7 @@ public:
|
||||
|
||||
// Call AddAnimation to add a new animation to this layer from layout code.
|
||||
// Caller must fill in all the properties of the returned animation.
|
||||
// A later animation overrides an earlier one.
|
||||
Animation* AddAnimation();
|
||||
// ClearAnimations clears animations on this layer.
|
||||
void ClearAnimations();
|
||||
|
@ -440,7 +440,8 @@ SampleAnimations(Layer* aLayer, TimeStamp aPoint)
|
||||
|
||||
bool activeAnimations = false;
|
||||
|
||||
for (uint32_t i = animations.Length(); i-- !=0; ) {
|
||||
// Process in order, since later animations override earlier ones.
|
||||
for (size_t i = 0, iEnd = animations.Length(); i < iEnd; ++i) {
|
||||
Animation& animation = animations[i];
|
||||
AnimData& animData = animationData[i];
|
||||
|
||||
|
@ -413,6 +413,7 @@ AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty,
|
||||
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR),
|
||||
"inconsistent property flags");
|
||||
|
||||
// Add from first to last (since last overrides)
|
||||
for (size_t playerIdx = 0; playerIdx < aPlayers.Length(); playerIdx++) {
|
||||
AnimationPlayer* player = aPlayers[playerIdx];
|
||||
if (!player->IsPlaying()) {
|
||||
@ -560,6 +561,8 @@ nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer(Layer* aLayer,
|
||||
data = null_t();
|
||||
}
|
||||
|
||||
// When both are running, animations override transitions. We want
|
||||
// to add the ones that override last.
|
||||
if (transitions) {
|
||||
AddAnimationsForProperty(aFrame, aProperty, transitions->mPlayers,
|
||||
aLayer, data, pending);
|
||||
|
Loading…
Reference in New Issue
Block a user