Bug 1341518 - We don't need to call SetNeedStyleFlush() explicitly in UpdateAnimations. r?birtles,mantaroh draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 22 Feb 2017 15:45:27 +0900
changeset 487826 a0d39eb75cde2854b6c1d50148f7d86ca98f05b0
parent 487236 d84beb192e57e26846c82d3df3599381f4663792
child 546562 63a9a9d0888761836e88124b57aed873ad9cbafa
push id46345
push userhikezoe@mozilla.com
push dateWed, 22 Feb 2017 06:46:02 +0000
reviewersbirtles, mantaroh
bugs1341518
milestone54.0a1
Bug 1341518 - We don't need to call SetNeedStyleFlush() explicitly in UpdateAnimations. r?birtles,mantaroh DocumentTimeline ensures the next tick, which is necessary for animation events, is processed. Actually CSSAnimation::QueueEvents() is called from WillRefresh(), the WillRefresh() is not called if the animation is not being observed by the DocumentTimeline. MozReview-Commit-ID: AYdqi7x3jty
layout/style/nsAnimationManager.cpp
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -463,24 +463,16 @@ nsAnimationManager::UpdateAnimations(nsS
     }
   }
   collection->mAnimations.SwapElements(newAnimations);
 
   // Cancel removed animations
   for (size_t newAnimIdx = newAnimations.Length(); newAnimIdx-- != 0; ) {
     newAnimations[newAnimIdx]->CancelFromStyle();
   }
-
-  // We don't actually dispatch the pending events now.  We'll either
-  // dispatch them the next time we get a refresh driver notification
-  // or the next time somebody calls
-  // nsPresShell::FlushPendingNotifications.
-  if (mEventDispatcher.HasQueuedEvents()) {
-    mPresContext->PresShell()->SetNeedStyleFlush();
-  }
 }
 
 void
 nsAnimationManager::StopAnimationsForElement(
   mozilla::dom::Element* aElement,
   mozilla::CSSPseudoElementType aPseudoType)
 {
   MOZ_ASSERT(aElement);