Bug 1304922 - Part 3: Request restyle for layer when CSS animation's index is changed. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Wed, 05 Oct 2016 14:26:29 +0900
changeset 421028 1d4356d095d21dd4b4a3339e24650c46f09edb70
parent 421027 58d1629479317e6acd23da08b79f890c188e8dc3
child 421029 2e7e1905f9e53cf4857ef9943329c80f5fadfc2c
push id31361
push userbmo:hiikezoe@mozilla-japan.org
push dateWed, 05 Oct 2016 06:56:42 +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: KcEFyBpALDA
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