Bug 1341518 - We don't need to call SetNeedStyleFlush() explicitly in UpdateAnimations. r=birtles,mantaroh
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 22 Feb 2017 15:45:27 +0900
changeset 489979 586854d5c3d4bab19a41c1695a06da4408005094
parent 489978 bc202c8a82358b949ecf825f3a291aa48aa3f937
child 489980 a95cda83b56d9d85158fbbfbe92bce8b592786d7
push id46964
push userbmo:mjzffr@gmail.com
push dateMon, 27 Feb 2017 13:49:06 +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);