Bug 1256731 - patch 3 - Don't pull the elements below the titlebar up so far they'll clash with the buttons, in the secondary lo-dpi case where the window controls are oversized. r=gijs a=ritu
authorJonathan Kew <jkew@mozilla.com>
Thu, 17 Mar 2016 16:05:42 +0000
changeset 323543 5c247ef4c02899a3ab3cf4626ae2eaf40868b493
parent 323542 99f4db364c3c0747fb1bf8b86e91b53029781e5d
child 323544 1abf0bb9827a840e026eceeedb9290afb5ba184c
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs, ritu
bugs1256731
milestone47.0a2
Bug 1256731 - patch 3 - Don't pull the elements below the titlebar up so far they'll clash with the buttons, in the secondary lo-dpi case where the window controls are oversized. r=gijs a=ritu
browser/base/content/browser-tabsintitlebar.js
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -205,19 +205,20 @@ var TabsInTitlebar = {
           titlebarContent.style.marginBottom = extraMargin + "px";
         }
 
         titlebarContentHeight += extraMargin;
       } else {
         titlebarContent.style.removeProperty("margin-bottom");
       }
 
-      // Then we bring up the titlebar by the same amount, but we add any negative margin:
-      titlebar.style.marginBottom = "-" + titlebarContentHeight + "px";
-
+      // Then add a negative margin to the titlebar, so that the following elements
+      // will overlap it by the lesser of the titlebar height or the tabstrip+menu.
+      let minTitlebarOrTabsHeight = Math.min(titlebarContentHeight, tabAndMenuHeight);
+      titlebar.style.marginBottom = "-" + minTitlebarOrTabsHeight + "px";
 
       // Finally, size the placeholders:
       if (AppConstants.platform == "macosx") {
         this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth);
       }
       this._sizePlaceholder("caption-buttons", captionButtonsBoxWidth);
 
     } else {