Bug 1374460 - Remove internal code that used to be used for showModalDialog. r=smaug draft
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 13 Jul 2017 17:20:10 -0700
changeset 642185 496704406240e8d3dec78dd93d080c43a1042698
parent 642184 4245fb0a5a71596982eec0dd84bd6ad7074e9094
child 724933 b89fe667f183b8a55ae3f4dafe0abfdb47bc2584
push id72678
push userbmo:mrbkap@mozilla.com
push dateMon, 07 Aug 2017 21:35:55 +0000
reviewerssmaug
bugs1374460
milestone57.0a1
Bug 1374460 - Remove internal code that used to be used for showModalDialog. r=smaug MozReview-Commit-ID: 4QuUpvbOiOA
toolkit/components/browser/nsIWebBrowserChrome.idl
toolkit/components/windowwatcher/nsWindowWatcher.cpp
--- a/toolkit/components/browser/nsIWebBrowserChrome.idl
+++ b/toolkit/components/browser/nsIWebBrowserChrome.idl
@@ -72,19 +72,16 @@ interface nsIWebBrowserChrome : nsISuppo
     //
     // CHROME_PRIVATE_LIFETIME causes the docshell to affect private-browsing
     // session lifetime.  This flag is currently respected only for remote
     // docshells.
     const unsigned long CHROME_PRIVATE_WINDOW         = 0x00010000;
     const unsigned long CHROME_NON_PRIVATE_WINDOW     = 0x00020000;
     const unsigned long CHROME_PRIVATE_LIFETIME       = 0x00040000;
 
-    // Whether this was opened by nsGlobalWindow::ShowModalDialog.
-    const unsigned long CHROME_MODAL_CONTENT_WINDOW   = 0x00080000;
-
     // Whether this window should use remote (out-of-process) tabs.
     const unsigned long CHROME_REMOTE_WINDOW          = 0x00100000;
 
     // Prevents new window animations on MacOS and Windows. Currently
     // ignored for Linux.
     const unsigned long CHROME_SUPPRESS_ANIMATION     = 0x01000000;
 
     const unsigned long CHROME_WINDOW_RAISED          = 0x02000000;
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -773,32 +773,16 @@ nsWindowWatcher::OpenWindowInternal(mozI
     // Until ShowModalDialog is removed, it's still possible for content to
     // request dialogs, but only in single-process mode.
     if (aDialog) {
       MOZ_ASSERT(XRE_IsParentProcess());
       chromeFlags |= nsIWebBrowserChrome::CHROME_OPENAS_DIALOG;
     }
   }
 
-  // If we're not called through our JS version of the API, and we got
-  // our internal modal option, treat the window we're opening as a
-  // modal content window (and set the modal chrome flag).
-  if (!aCalledFromJS && aArgv &&
-      WinHasOption(features, "-moz-internal-modal", 0, nullptr)) {
-    windowIsModalContentDialog = true;
-
-    // CHROME_MODAL gets inherited by dependent windows, which affects various
-    // platform-specific window state (especially on OSX). So we need some way
-    // to determine that this window was actually opened by nsGlobalWindow::
-    // ShowModalDialog(), and that somebody is actually going to be watching
-    // for return values and all that.
-    chromeFlags |= nsIWebBrowserChrome::CHROME_MODAL_CONTENT_WINDOW;
-    chromeFlags |= nsIWebBrowserChrome::CHROME_MODAL;
-  }
-
   SizeSpec sizeSpec;
   CalcSizeSpec(features, sizeSpec);
 
   // XXXbz Why is an AutoJSAPI good enough here?  Wouldn't AutoEntryScript (so
   // we affect the entry global) make more sense?  Or do we just want to affect
   // GetSubjectPrincipal()?
   dom::AutoJSAPI jsapiChromeGuard;