Bug 1336230 - Rename macsuppressanimation and CHROME_MAC_SUPPRESS_ANIMATION to be platform agnostic. r=jimm
authorMike Conley <mconley@mozilla.com>
Fri, 03 Feb 2017 16:04:33 -0500
changeset 479865 48c77c39e587b7b920defb69fd2b6898cff06093
parent 479649 4f4dcc23d36b2c9598349c0a05583efb9fefd0c3
child 479866 768bf846fac5a0ccd56c77fe404e3dcc059035a5
push id44393
push userVYV03354@nifty.ne.jp
push dateTue, 07 Feb 2017 13:53:48 +0000
reviewersjimm
bugs1336230
milestone54.0a1
Bug 1336230 - Rename macsuppressanimation and CHROME_MAC_SUPPRESS_ANIMATION to be platform agnostic. r=jimm MozReview-Commit-ID: HWyrm1lVwdY
browser/components/sessionstore/SessionStore.jsm
toolkit/components/browser/nsIWebBrowserChrome.idl
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js
xpfe/appshell/nsAppShellService.cpp
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -4027,17 +4027,17 @@ var SessionStoreInternal = {
    *        Object containing session data
    */
   _openWindowWithState: function ssi_openWindowWithState(aState) {
     var argString = Cc["@mozilla.org/supports-string;1"].
                     createInstance(Ci.nsISupportsString);
     argString.data = "";
 
     // Build feature string
-    let features = "chrome,dialog=no,macsuppressanimation,all";
+    let features = "chrome,dialog=no,suppressanimation,all";
     let winState = aState.windows[0];
     WINDOW_ATTRIBUTES.forEach(function(aFeature) {
       // Use !isNaN as an easy way to ignore sizemode and check for numbers
       if (aFeature in winState && !isNaN(winState[aFeature]))
         features += "," + aFeature + "=" + winState[aFeature];
     });
 
     if (winState.isPrivate) {
--- a/toolkit/components/browser/nsIWebBrowserChrome.idl
+++ b/toolkit/components/browser/nsIWebBrowserChrome.idl
@@ -78,19 +78,19 @@ interface nsIWebBrowserChrome : nsISuppo
     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 Mac OS X Lion.  Ignored on other
-    // platforms.
-    const unsigned long CHROME_MAC_SUPPRESS_ANIMATION = 0x01000000;
+    // 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;
     const unsigned long CHROME_WINDOW_LOWERED         = 0x04000000;
     const unsigned long CHROME_CENTER_SCREEN          = 0x08000000;
 
     // Make the new window dependent on the parent.  This flag is only
     // meaningful if CHROME_OPENAS_CHROME is set; content windows should not be
     // dependent.
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -1923,18 +1923,18 @@ nsWindowWatcher::CalculateChromeFlagsFor
 
   if (WinHasOption(aFeatures, "alwaysLowered", 0, nullptr) ||
       WinHasOption(aFeatures, "z-lock", 0, nullptr)) {
     chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_LOWERED;
   } else if (WinHasOption(aFeatures, "alwaysRaised", 0, nullptr)) {
     chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_RAISED;
   }
 
-  chromeFlags |= WinHasOption(aFeatures, "macsuppressanimation", 0, nullptr) ?
-    nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION : 0;
+  chromeFlags |= WinHasOption(aFeatures, "suppressanimation", 0, nullptr) ?
+    nsIWebBrowserChrome::CHROME_SUPPRESS_ANIMATION : 0;
 
   chromeFlags |= WinHasOption(aFeatures, "chrome", 0, nullptr) ?
     nsIWebBrowserChrome::CHROME_OPENAS_CHROME : 0;
   chromeFlags |= WinHasOption(aFeatures, "extrachrome", 0, nullptr) ?
     nsIWebBrowserChrome::CHROME_EXTRA : 0;
   chromeFlags |= WinHasOption(aFeatures, "centerscreen", 0, nullptr) ?
     nsIWebBrowserChrome::CHROME_CENTER_SCREEN : 0;
   chromeFlags |= WinHasOption(aFeatures, "dependent", 0, nullptr) ?
--- a/toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js
+++ b/toolkit/components/windowwatcher/test/browser_new_content_window_chromeflags.js
@@ -83,17 +83,17 @@ const DISALLOWED = {
   "z-lock": {
     flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_LOWERED, // Renamed to alwaysLowered
     defaults_to: false,
   },
   "alwaysRaised": {
     flag: Ci.nsIWebBrowserChrome.CHROME_WINDOW_RAISED,
     defaults_to: false,
   },
-  "macsuppressanimation": {
+  "suppressanimation": {
     flag: Ci.nsIWebBrowserChrome.CHROME_MAC_SUPPRESS_ANIMATION,
     defaults_to: false,
   },
   "extrachrome": {
     flag: Ci.nsIWebBrowserChrome.CHROME_EXTRA,
     defaults_to: false,
   },
   "centerscreen": {
--- a/xpfe/appshell/nsAppShellService.cpp
+++ b/xpfe/appshell/nsAppShellService.cpp
@@ -180,17 +180,17 @@ nsAppShellService::DestroyHiddenWindow()
   return NS_OK;
 }
 
 /*
  * Create a new top level window and display the given URL within it...
  */
 NS_IMETHODIMP
 nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent,
-                                        nsIURI *aUrl, 
+                                        nsIURI *aUrl,
                                         uint32_t aChromeMask,
                                         int32_t aInitialWidth,
                                         int32_t aInitialHeight,
                                         nsITabParent *aOpeningTab,
                                         mozIDOMWindowProxy *aOpenerWindow,
                                         nsIXULWindow **aResult)
 
 {
@@ -653,17 +653,17 @@ nsAppShellService::JustCreateTopWindow(n
     widgetInitData.mWindowType = eWindowType_invisible;
   else
     widgetInitData.mWindowType = aChromeMask & nsIWebBrowserChrome::CHROME_OPENAS_DIALOG ?
       eWindowType_dialog : eWindowType_toplevel;
 
   if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_POPUP)
     widgetInitData.mWindowType = eWindowType_popup;
 
-  if (aChromeMask & nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION)
+  if (aChromeMask & nsIWebBrowserChrome::CHROME_SUPPRESS_ANIMATION)
     widgetInitData.mIsAnimationSuppressed = true;
 
 #ifdef XP_MACOSX
   // Mac OS X sheet support
   // Adding CHROME_OPENAS_CHROME to sheetMask makes modal windows opened from
   // nsGlobalWindow::ShowModalDialog() be dialogs (not sheets), while modal
   // windows opened from nsPromptService::DoDialog() still are sheets.  This
   // fixes bmo bug 395465 (see nsCocoaWindow::StandardCreate() and
@@ -705,17 +705,17 @@ nsAppShellService::JustCreateTopWindow(n
         widgetInitData.mBorderStyle = static_cast<enum nsBorderStyle>(widgetInitData.mBorderStyle | eBorderStyle_maximize);
     }
     // all windows (except dialogs) get minimize buttons and the system menu
     if (!(aChromeMask & nsIWebBrowserChrome::CHROME_OPENAS_DIALOG))
       widgetInitData.mBorderStyle = static_cast<enum nsBorderStyle>(widgetInitData.mBorderStyle | eBorderStyle_minimize | eBorderStyle_menu);
     // but anyone can explicitly ask for a minimize button
     if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_MIN) {
       widgetInitData.mBorderStyle = static_cast<enum nsBorderStyle>(widgetInitData.mBorderStyle | eBorderStyle_minimize);
-    }  
+    }
   }
 
   if (aInitialWidth == nsIAppShellService::SIZE_TO_CONTENT ||
       aInitialHeight == nsIAppShellService::SIZE_TO_CONTENT) {
     aInitialWidth = 1;
     aInitialHeight = 1;
     window->SetIntrinsicallySized(true);
   }