Bug 1185482 - Remove gap between titlebar buttons and navigation toolbar r=dao
authorUK992 <urbankrajnc92@gmail.com>
Sat, 10 Jun 2017 18:20:53 +0200
changeset 363392 806cf3746d111cd359fcea0938959b0582448ad6
parent 363391 35bdd25a810319b52365a12da51df0ac2426c6cc
child 363393 c26e124516f41cddf6f6908b870b884612d2138c
push id32006
push userarchaeopteryx@coole-files.de
push dateSun, 11 Jun 2017 08:35:56 +0000
treeherdermozilla-central@799d43edb324 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1185482
milestone55.0a1
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
Bug 1185482 - Remove gap between titlebar buttons and navigation toolbar r=dao MozReview-Commit-ID: AD2opbF4Uxn
browser/base/content/browser-tabsintitlebar.js
toolkit/modules/AppConstants.jsm
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -171,16 +171,26 @@ 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
 
+      if (AppConstants.MOZ_PHOTON_THEME &&
+          AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
+        if (!menuHeight) {
+          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
         let menuTitlebarDelta = titlebarContentHeight - fullMenuHeight;
         let paddingBottom;
         // The titlebar is bigger:
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -357,9 +357,16 @@ this.AppConstants = Object.freeze({
 
   MOZ_PHOTON_ANIMATIONS:
 #ifdef MOZ_PHOTON_ANIMATIONS
     true,
 #else
     false,
 #endif
 
+  MOZ_PHOTON_THEME:
+#ifdef MOZ_PHOTON_THEME
+    true,
+#else
+    false,
+#endif
+
 });