Bug 1024343: The document should not stop animations when it is being swapped. r=smaug
authorMihai Volmer <mvolmer@mozilla.com>
Fri, 21 Aug 2015 17:23:14 -0700
changeset 296837 62dbe8652b14bcda337b6fb897b2d55f8f0f6ef0
parent 296836 9738f1b3f11a89c44c73e1be094d2a6b6f286ec4
child 296838 59b6a838f0f266f8089f68092d10dcf3348a9a07
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1024343
milestone43.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 1024343: The document should not stop animations when it is being swapped. r=smaug
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -9297,17 +9297,20 @@ nsDocument::OnPageHide(bool aPersisted,
     // move us around.
     mIsShowing = false;
   }
 
   if (mAnimationController) {
     mAnimationController->OnPageHide();
   }
 
-  if (aPersisted) {
+  // We do not stop the animations (bug 1024343)
+  // when the page is refreshing while being dragged out
+  nsDocShell* docShell = mDocumentContainer.get();
+  if (aPersisted && !(docShell && docShell->InFrameSwap())) {
     SetImagesNeedAnimating(false);
   }
 
   MozExitPointerLock();
 
   // Now send out a PageHide event.
   nsCOMPtr<EventTarget> target = aDispatchStartTarget;
   if (!target) {