Merge backout of changeset 2752efeb2fdd (Bug 535004: Check if we've fired an unload event before calling OnPageShow, in DocumentViewerImpl::LoadComplete) because the NS_ABORT_IF_FALSE that it added is firing in reftest and crashtest, at least on Linux.
authorL. David Baron <dbaron@dbaron.org>
Wed, 23 Dec 2009 23:05:37 -0500
changeset 36644 7a68e56bb96a082845105d9a8c3f721b185bbaf5
parent 36642 454c8ec86b1e6c6fbf5f9b6af69c9c48927fb562 (current diff)
parent 36643 03bec0d8715431e0ce811be9d7fe98e37c970978 (diff)
child 36645 5c0c836b0d06157dc1c9410aa534dcb5c675bbec
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs535004
milestone1.9.3a1pre
Merge backout of changeset 2752efeb2fdd (Bug 535004: Check if we've fired an unload event before calling OnPageShow, in DocumentViewerImpl::LoadComplete) because the NS_ABORT_IF_FALSE that it added is firing in reftest and crashtest, at least on Linux.
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -3604,21 +3604,16 @@ nsDocument::SetScriptGlobalObject(nsIScr
 #ifdef DEBUG
   {
     nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(aScriptGlobalObject));
 
     NS_ASSERTION(!win || win->IsInnerWindow(),
                  "Script global object must be an inner window!");
   }
 #endif
-  NS_ABORT_IF_FALSE(aScriptGlobalObject || !mAnimationController ||
-                    mAnimationController->IsPausedByType(
-                        nsSMILTimeContainer::PAUSE_PAGEHIDE |
-                        nsSMILTimeContainer::PAUSE_BEGIN),
-                    "Clearing window pointer while animations are unpaused");
 
   if (mScriptGlobalObject && !aScriptGlobalObject) {
     // We're detaching from the window.  We need to grab a pointer to
     // our layout history state now.
     mLayoutHistoryState = GetLayoutHistoryState();
 
     // Also make sure to remove our onload blocker now if we haven't done it yet
     if (mOnloadBlockCount != 0) {
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1062,19 +1062,20 @@ DocumentViewerImpl::LoadComplete(nsresul
   // Notify the document that it has been shown (regardless of whether
   // it was just loaded). Note: mDocument may be null now if the above
   // firing of onload caused the document to unload.
   if (mDocument) {
     // Re-get window, since it might have changed during above firing of onload
     window = mDocument->GetWindow();
     if (window) {
       nsIDocShell *docShell = window->GetDocShell();
-      PRBool isInUnload;
-      if (docShell && NS_SUCCEEDED(docShell->GetIsInUnload(&isInUnload)) &&
-          !isInUnload) {
+      PRBool beingDestroyed;
+      if (docShell &&
+          NS_SUCCEEDED(docShell->IsBeingDestroyed(&beingDestroyed)) &&
+          !beingDestroyed) {
         mDocument->OnPageShow(restoring, nsnull);
       }
     }
   }
 
   // Now that the document has loaded, we can tell the presshell
   // to unsuppress painting.
   if (mPresShell && !mStopped) {