Backed out changeset 37ba4f932f57 (bug 1375335) for failing browser_windowopen_reflows.js on OS X. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 14 Aug 2017 15:28:01 +0200
changeset 374623 c218d170bd314525d9e0e83090a8668753a23ed2
parent 374622 8fba8ca208f29b73161d38eb06f91ae3325fb3fb
child 374624 8de0e5e7d0fa1f4f6ebb031af0e9ce619651ae2b
push id93728
push userkwierso@gmail.com
push dateTue, 15 Aug 2017 00:58:32 +0000
treeherdermozilla-inbound@ec83c820877e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1375335
milestone57.0a1
backs out37ba4f932f57fc60bf27554b5d36df3c721df75f
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
Backed out changeset 37ba4f932f57 (bug 1375335) for failing browser_windowopen_reflows.js on OS X. r=backout
browser/base/content/browser-tabsintitlebar.js
browser/base/content/test/performance/browser_windowopen_reflows.js
browser/themes/windows/browser-aero.css
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -143,29 +143,23 @@ var TabsInTitlebar = {
     let menubar = $("toolbar-menubar");
 
     if (allowed) {
       // We set the tabsintitlebar attribute first so that our CSS for
       // tabsintitlebar manifests before we do our measurements.
       document.documentElement.setAttribute("tabsintitlebar", "true");
       updateTitlebarDisplay();
 
-      // Reset the custom titlebar height if the menubar is shown,
-      // because we will want to calculate its original height.
-      if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0") &&
-          (menubar.getAttribute("inactive") != "true" ||
-          menubar.getAttribute("autohide") != "true")) {
-        $("titlebar-buttonbox").style.removeProperty("height");
-      }
-
       // Try to avoid reflows in this code by calculating dimensions first and
       // then later set the properties affecting layout together in a batch.
 
-      // Get the height of the tabs toolbar:
-      let tabsHeight = rect($("TabsToolbar")).height;
+      // Get the full height of the tabs toolbar:
+      let tabsToolbar = $("TabsToolbar");
+      let tabsStyles = window.getComputedStyle(tabsToolbar);
+      let fullTabsHeight = rect(tabsToolbar).height + verticalMargins(tabsStyles);
       // Buttons first:
       let captionButtonsBoxWidth = rect($("titlebar-buttonbox-container")).width;
 
       let secondaryButtonsWidth, menuHeight, fullMenuHeight, menuStyles;
       if (AppConstants.platform == "macosx") {
         secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width;
         // No need to look up the menubar stuff on OS X:
         menuHeight = 0;
@@ -177,22 +171,22 @@ var TabsInTitlebar = {
         fullMenuHeight = verticalMargins(menuStyles) + menuHeight;
       }
 
       // And get the height of what's in the titlebar:
       let titlebarContentHeight = rect(titlebarContent).height;
 
       // Begin setting CSS properties which will cause a reflow
 
-      // On Windows 10, adjust the window controls to span the entire
-      // tab strip height if we're not showing a menu bar.
       if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
-        if (!menuHeight) {
-          titlebarContentHeight = tabsHeight;
+        if (!menuHeight && window.windowState == window.STATE_MAXIMIZED) {
+          titlebarContentHeight = Math.max(titlebarContentHeight, fullTabsHeight);
           $("titlebar-buttonbox").style.height = titlebarContentHeight + "px";
+        } else {
+          $("titlebar-buttonbox").style.removeProperty("height");
         }
       }
 
       // If the menubar is around (menuHeight is non-zero), try to adjust
       // its full height (i.e. including margins) to match the titlebar,
       // by changing the menubar's bottom padding
       if (menuHeight) {
         // Calculate the difference between the titlebar's height and that of the menubar
@@ -215,17 +209,17 @@ var TabsInTitlebar = {
           menubar.style.paddingBottom = desiredPadding + "px";
           // We've changed the menu height now:
           fullMenuHeight += desiredPadding - existingPadding;
         }
       }
 
       // Next, we calculate how much we need to stretch the titlebar down to
       // go all the way to the bottom of the tab strip, if necessary.
-      let tabAndMenuHeight = tabsHeight + fullMenuHeight;
+      let tabAndMenuHeight = fullTabsHeight + fullMenuHeight;
 
       if (tabAndMenuHeight > titlebarContentHeight) {
         // We need to increase the titlebar content's outer height (ie including margins)
         // to match the tab and menu height:
         let extraMargin = tabAndMenuHeight - titlebarContentHeight;
         if (AppConstants.platform != "macosx") {
           titlebarContent.style.marginBottom = extraMargin + "px";
         }
--- a/browser/base/content/test/performance/browser_windowopen_reflows.js
+++ b/browser/base/content/test/performance/browser_windowopen_reflows.js
@@ -49,16 +49,26 @@ if (Services.appinfo.OS == "Darwin") {
     ],
   });
 }
 
 if (Services.appinfo.OS == "WINNT") {
   EXPECTED_REFLOWS.push(
     {
       stack: [
+        "verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
+        "_update@chrome://browser/content/browser-tabsintitlebar.js",
+        "init@chrome://browser/content/browser-tabsintitlebar.js",
+        "handleEvent@chrome://browser/content/tabbrowser.xml",
+      ],
+      times: 2, // This number should only ever go down - never up.
+    },
+
+    {
+      stack: [
         "handleEvent@chrome://browser/content/tabbrowser.xml",
         "inferFromText@chrome://browser/content/browser.js",
         "handleEvent@chrome://browser/content/browser.js",
       ],
     },
 
     {
       stack: [
--- a/browser/themes/windows/browser-aero.css
+++ b/browser/themes/windows/browser-aero.css
@@ -2,21 +2,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 %filter substitution
 %define toolbarShadowColor hsla(209,67%,12%,0.35)
 %define glassActiveBorderColor rgb(37, 44, 51)
 %define glassInactiveBorderColor rgb(102, 102, 102)
 
-@media (-moz-os-version: windows-win7) {
-  @media not all and (-moz-windows-classic) {
-    #main-window[sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
-      margin-top: 1px;
-    }
+@media not all and (-moz-windows-classic) {
+  #main-window[sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
+    margin-top: 1px;
   }
 }
 
 @media (-moz-windows-default-theme) {
   .sidebar-header,
   #sidebar-header {
     -moz-appearance: none;
     border-bottom: none;
@@ -78,21 +76,26 @@
       #titlebar-buttonbox,
       .titlebar-button {
         -moz-appearance: none !important;
       }
 
       .titlebar-button {
         border: none;
         margin: 0 !important;
-        padding: 8px 17px;
+        padding: 10px 17px;
         -moz-context-properties: stroke;
         stroke: var(--titlebar-text-color);
       }
 
+      :root[sizemode=maximized] .titlebar-button {
+        padding-top: 8px;
+        padding-bottom: 8px;
+      }
+
       .titlebar-button > .toolbarbutton-icon {
         width: 12px;
         height: 12px;
       }
 
       #titlebar-min {
         list-style-image: url(chrome://browser/skin/window-controls/minimize.svg);
       }