Bug 1336230 - Rename macsuppressanimation and CHROME_MAC_SUPPRESS_ANIMATION to be platform agnostic. r?jimm draft
authorMike Conley <mconley@mozilla.com>
Fri, 03 Feb 2017 16:04:33 -0500
changeset 470535 038ef2e591c522bfd39efe9d04c4515eb177bb6f
parent 470437 bf15d4078c2a6db7df37ab466d28a1e075c9eb4d
child 470536 578c035dcbfc3ced2e4a3ecaec666495e504744f
child 470539 2114f193a2c7cfea8080484cea888aaffbbd205a
push id44067
push usermconley@mozilla.com
push dateFri, 03 Feb 2017 22:47:59 +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);
   }