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
--- 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);