Bug 1304922 - Part 3: Request restyle for layer when CSS animation's index is changed. r?birtles
In the case when the animation index is changed, we have to update the layer
because the index affects composite order.
Currently UpdateCascadeResult() does it but the function will check
only which cascade level wins in the cascade level and request restyle
only when the winner is changed, e.g. when a CSS animation overrides a
CSS transition, etc. So we should call request restyle respectively when the index
is changed inside each Animation class.
MozReview-Commit-ID: KcEFyBpALDA
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -135,16 +135,17 @@ public:
bool HasLowerCompositeOrderThan(const CSSAnimation& aOther) const;
void SetAnimationIndex(uint64_t aIndex)
{
MOZ_ASSERT(IsTiedToMarkup());
if (IsRelevant() &&
mAnimationIndex != aIndex) {
nsNodeUtils::AnimationChanged(this);
+ PostUpdate();
}
mAnimationIndex = aIndex;
}
// Sets the owning element which is used for determining the composite
// order of CSSAnimation objects generated from CSS markup.
//
// @see mOwningElement