Bug 1304922 - Part 3: Request restyle for layer when CSS animation's index is changed. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Mon, 03 Oct 2016 06:33:30 +0900
changeset 420101 74dc8dfe6b2a4ef64217f449c8c8c2a2688d7602
parent 420100 ee0d1808b13d6a0da9e7a232e3c7ff1a9cb73a05
child 420102 ebf78468df6e2b22f23839fa8091ff6a3f33e9c6
push id31094
push userbmo:hiikezoe@mozilla-japan.org
push dateMon, 03 Oct 2016 10:02:30 +0000
reviewersbirtles
bugs1304922
milestone52.0a1
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: 7KsABTfD01a
layout/style/nsAnimationManager.h
--- 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