Bug 1072342, the child process doesn't have a main widget, r=smaug
authorNeil Deakin <neil@mozilla.com>
Thu, 27 Nov 2014 08:27:39 -0500
changeset 242180 3203aa5a606947e7b362e458ca98562eecd6ce26
parent 242179 469fdce88cb70d4bb0c74c2902762cd69acfd862
child 242181 eeb943d179c5bc20052df881238c938b1ff5f7dd
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1072342
milestone36.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 1072342, the child process doesn't have a main widget, r=smaug
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -9819,24 +9819,24 @@ nsGlobalWindow::GetLocation(nsIDOMLocati
 void
 nsGlobalWindow::ActivateOrDeactivate(bool aActivate)
 {
   MOZ_ASSERT(IsOuterWindow());
 
   // Set / unset mIsActive on the top level window, which is used for the
   // :-moz-window-inactive pseudoclass, and its sheet (if any).
   nsCOMPtr<nsIWidget> mainWidget = GetMainWidget();
-  if (!mainWidget)
-    return;
-
-  // Get the top level widget (if the main widget is a sheet, this will
-  // be the sheet's top (non-sheet) parent).
-  nsCOMPtr<nsIWidget> topLevelWidget = mainWidget->GetSheetWindowParent();
-  if (!topLevelWidget) {
-    topLevelWidget = mainWidget;
+  nsCOMPtr<nsIWidget> topLevelWidget;
+  if (mainWidget) {
+    // Get the top level widget (if the main widget is a sheet, this will
+    // be the sheet's top (non-sheet) parent).
+    topLevelWidget = mainWidget->GetSheetWindowParent();
+    if (!topLevelWidget) {
+      topLevelWidget = mainWidget;
+    }
   }
 
   nsCOMPtr<nsPIDOMWindow> piMainWindow(
     do_QueryInterface(static_cast<nsIDOMWindow*>(this)));
   piMainWindow->SetActive(aActivate);
 
   if (mainWidget != topLevelWidget) {
     // This is a workaround for the following problem: