Bug 1335450. Fix our condition for rescheduling frame request callbacks. r=mrbkap
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 15 Feb 2017 18:31:36 -0500
changeset 343224 492fa407d12ca8ef6adf35051cee7356d75ac2c1
parent 343223 4ea36a9c2dfdaa7dcc110de361cd20d22efb231f
child 343225 f5d3690285980b574bd87d2b1bfbd81de5964a57
push id31372
push usercbook@mozilla.com
push dateThu, 16 Feb 2017 12:16:10 +0000
treeherdermozilla-central@2737f66ad6ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1335450
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1335450. Fix our condition for rescheduling frame request callbacks. r=mrbkap
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3814,17 +3814,17 @@ nsDocument::CreateShell(nsPresContext* a
   RebuildUserFontSet();
 
   return shell.forget();
 }
 
 void
 nsDocument::MaybeRescheduleAnimationFrameNotifications()
 {
-  if (!mPresShell || !IsEventHandlingEnabled()) {
+  if (!mPresShell || !IsEventHandlingEnabled() || AnimationsPaused()) {
     // bail out for now, until one of those conditions changes
     return;
   }
 
   nsRefreshDriver* rd = mPresShell->GetPresContext()->RefreshDriver();
   if (!mFrameRequestCallbacks.IsEmpty()) {
     rd->ScheduleFrameRequestCallbacks(this);
   }
@@ -10068,17 +10068,17 @@ nsIDocument::ScheduleFrameRequestCallbac
 }
 
 void
 nsIDocument::CancelFrameRequestCallback(int32_t aHandle)
 {
   // mFrameRequestCallbacks is stored sorted by handle
   if (mFrameRequestCallbacks.RemoveElementSorted(aHandle) &&
       mFrameRequestCallbacks.IsEmpty() &&
-      mPresShell && IsEventHandlingEnabled()) {
+      mPresShell && IsEventHandlingEnabled() && !AnimationsPaused()) {
     mPresShell->GetPresContext()->RefreshDriver()->
       RevokeFrameRequestCallbacks(this);
   }
 }
 
 nsresult
 nsDocument::GetStateObject(nsIVariant** aState)
 {