Backing out 'Call Show if our nsIXULWindow will not' patch from bug 574690 due to various regressions. r=bz
authorJim Mathies <jmathies@mozilla.com>
Thu, 15 Jul 2010 21:47:14 -0500
changeset 47783 d4aafb90ff969879dc41cd06f9cfbd1eb3f3c95e
parent 46329 7ad36412775e77a4a6e593c4c7dfd4559a64463f
child 47784 aba8cc27fcef3ceafc61f10e0090150e1b1c0849
push id14418
push userjmathies@mozilla.com
push dateFri, 16 Jul 2010 03:40:19 +0000
treeherderautoland@7124132f0506 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs574690
milestone1.9.3a6pre
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
Backing out 'Call Show if our nsIXULWindow will not' patch from bug 574690 due to various regressions. r=bz
layout/base/nsDocumentViewer.cpp
xpfe/appshell/public/nsIXULWindow.idl
xpfe/appshell/src/nsXULWindow.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -105,17 +105,16 @@
 #include "nsHTMLReflowState.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIDOMHTMLAreaElement.h"
 #include "nsIDOMHTMLLinkElement.h"
 #include "nsIImageLoadingContent.h"
 #include "nsCopySupport.h"
 #include "nsIDOMHTMLFrameSetElement.h"
 #ifdef MOZ_XUL
-#include "nsIXULWindow.h"
 #include "nsIXULDocument.h"
 #include "nsXULPopupManager.h"
 #endif
 #include "nsPrintfCString.h"
 
 #include "nsIClipboardHelper.h"
 
 #include "nsPIDOMWindow.h"
@@ -1939,34 +1938,17 @@ DocumentViewerImpl::Show(void)
         printf("About to evict content viewers: prev=%d, loaded=%d\n",
                prevIndex, loadedIndex);
 #endif
         historyInt->EvictContentViewers(prevIndex, loadedIndex);
       }
     }
   }
 
-  // XXX - If this DocumentViewer belongs to an nsIXULWindow that will at some
-  // point in the future call 'Show' on its window, we shouldn't call it.
-  // See bug 574690.
-  nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryReferent(mContainer);
-  nsCOMPtr<nsIXULWindow> xulWin;
-  PRBool willShowWindow = PR_FALSE;
-  if (treeItem) {
-    nsCOMPtr<nsIDocShellTreeOwner> owner;
-    treeItem->GetTreeOwner(getter_AddRefs(owner));
-    if (owner) {
-      xulWin = do_GetInterface(owner);
-      if (xulWin) {
-        xulWin->WillShowWindow(&willShowWindow);
-      }
-    }
-  }
-
-  if (mWindow && !willShowWindow) {
+  if (mWindow) {
     mWindow->Show(PR_TRUE);
   }
 
   if (mDocument && !mPresShell) {
     NS_ASSERTION(!mWindow, "Window already created but no presshell?");
 
     nsCOMPtr<nsIBaseWindow> base_win(do_QueryReferent(mContainer));
     if (base_win) {
--- a/xpfe/appshell/public/nsIXULWindow.idl
+++ b/xpfe/appshell/public/nsIXULWindow.idl
@@ -144,15 +144,9 @@ interface nsIXULWindow : nsISupports
 
   /**
    * Back-door method to force application of chrome flags at a particular
    * time.  Do NOT call this unless you know what you're doing!  In particular,
    * calling this when this XUL window doesn't yet have a document in its
    * docshell could cause problems.
    */
   [noscript] void applyChromeFlags();
-
-  /**
-   * This will return true if this nsIXULWindow will call show on its
-   * widget once it has finished loading chrome.
-   */
-  PRBool willShowWindow();
 };
--- a/xpfe/appshell/src/nsXULWindow.cpp
+++ b/xpfe/appshell/src/nsXULWindow.cpp
@@ -2051,22 +2051,16 @@ NS_IMETHODIMP nsXULWindow::ApplyChromeFl
 
   // Note that if we're not actually changing the value this will be a no-op,
   // so no need to compare to the old value.
   window->SetAttribute(NS_LITERAL_STRING("chromehidden"), newvalue);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsXULWindow::WillShowWindow(PRBool *aRetval)
-{
-  *aRetval = mShowAfterLoad && !mChromeLoaded;
-  return NS_OK;
-}
-
 NS_IMETHODIMP nsXULWindow::GetXULBrowserWindow(nsIXULBrowserWindow * *aXULBrowserWindow)
 {
   NS_IF_ADDREF(*aXULBrowserWindow = mXULBrowserWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsXULWindow::SetXULBrowserWindow(nsIXULBrowserWindow * aXULBrowserWindow)
 {