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:
L. David Baron 2015-03-31 15:05:55 -07:00
parent 1fe6a61ae9
commit e90b72b9db
3 changed files with 6 additions and 1 deletions

View File

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

View File

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

View File

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