Bug 1406478 - Set browser.tabs.tabMinWidth to 76. r?jaws draft
authorDão Gottwald <dao@mozilla.com>
Mon, 09 Oct 2017 19:38:47 +0200
changeset 676773 d96178f2b19a918dd19711306485134fe89544fb
parent 676713 613f64109bdef590b9748355441b3c620efa7be5
child 735066 2dab2578b71eb109aa7e9e7137948aca7bec9ed2
push id83636
push userdgottwald@mozilla.com
push dateMon, 09 Oct 2017 17:39:13 +0000
reviewersjaws
bugs1406478
milestone58.0a1
Bug 1406478 - Set browser.tabs.tabMinWidth to 76. r?jaws MozReview-Commit-ID: 3bbTd1Fmtc5
browser/app/profile/firefox.js
browser/base/content/browser.css
browser/base/content/test/general/browser_tabReorder.js
browser/themes/shared/tabs.inc.css
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -454,16 +454,17 @@ pref("browser.tabs.warnOnCloseOtherTabs"
 pref("browser.tabs.warnOnOpen", true);
 pref("browser.tabs.maxOpenBeforeWarn", 15);
 pref("browser.tabs.loadInBackground", true);
 pref("browser.tabs.opentabfor.middleclick", true);
 pref("browser.tabs.loadDivertedInBackground", false);
 pref("browser.tabs.loadBookmarksInBackground", false);
 pref("browser.tabs.loadBookmarksInTabs", false);
 pref("browser.tabs.tabClipWidth", 140);
+pref("browser.tabs.tabMinWidth", 76);
 #ifdef UNIX_BUT_NOT_MAC
 pref("browser.tabs.drawInTitlebar", false);
 #else
 pref("browser.tabs.drawInTitlebar", true);
 #endif
 
 // Offer additional drag space to the user. The drag space
 // will only be shown if browser.tabs.drawInTitlebar is true.
@@ -482,19 +483,16 @@ pref("browser.tabs.restorebutton", 0);
 // true   return to the tab that opened this tab (its owner)
 // false  return to the adjacent tab (old default)
 pref("browser.tabs.selectOwnerOnClose", true);
 
 pref("browser.tabs.showAudioPlayingIcon", true);
 // This should match Chromium's audio indicator delay.
 pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000);
 
-// The minimum tab width in pixels
-pref("browser.tabs.tabMinWidth", 50);
-
 pref("browser.ctrlTab.previews", false);
 
 // By default, do not export HTML at shutdown.
 // If true, at shutdown the bookmarks in your menu and toolbar will
 // be exported as HTML to the bookmarks.html file.
 pref("browser.bookmarks.autoExportHTML",          false);
 
 // The maximum number of daily bookmark backups to
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -5,17 +5,16 @@
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 @namespace html url("http://www.w3.org/1999/xhtml");
 
 :root {
   --panelui-subview-transition-duration: 150ms;
   --lwt-additional-images: none;
   --lwt-background-alignment: right top;
   --lwt-background-tiling: no-repeat;
-  --tab-min-width: 50px;
 }
 
 :root:-moz-lwtheme {
   color: var(--lwt-text-color) !important;
 }
 
 :root:-moz-lwtheme {
   background-color: var(--lwt-accent-color) !important;
@@ -134,16 +133,21 @@ tabbrowser {
   -moz-box-flex: 100;
   max-width: 225px;
   min-width: var(--tab-min-width);
   width: 0;
   transition: min-width 100ms ease-out,
               max-width 100ms ease-out;
 }
 
+:root[uidensity=touch] .tabbrowser-tab:not([pinned]) {
+  /* Touch mode needs additional space for the close button. */
+  min-width: calc(var(--tab-min-width) + 10px);
+}
+
 .tabbrowser-tab:not([pinned]):not([fadein]) {
   max-width: 0.1px;
   min-width: 0.1px;
   visibility: hidden;
 }
 
 .tab-close-button,
 .tab-background {
--- a/browser/base/content/test/general/browser_tabReorder.js
+++ b/browser/base/content/test/general/browser_tabReorder.js
@@ -13,21 +13,16 @@ add_task(async function() {
     }
   });
 
   is(gBrowser.tabs.length, initialTabsLength + 3, "new tabs are opened");
   is(gBrowser.tabs[initialTabsLength], newTab1, "newTab1 position is correct");
   is(gBrowser.tabs[initialTabsLength + 1], newTab2, "newTab2 position is correct");
   is(gBrowser.tabs[initialTabsLength + 2], newTab3, "newTab3 position is correct");
 
-  let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
-                     getService(Ci.mozIJSSubScriptLoader);
-  let EventUtils = {};
-  scriptLoader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
-
   async function dragAndDrop(tab1, tab2, copy) {
     let rect = tab2.getBoundingClientRect();
     let event = {
       ctrlKey: copy,
       altKey: copy,
       clientX: rect.left + rect.width / 2 + 10,
       clientY: rect.top + rect.height / 2,
     };
--- a/browser/themes/shared/tabs.inc.css
+++ b/browser/themes/shared/tabs.inc.css
@@ -5,16 +5,17 @@
 %endif
 %filter substitution
 %define horizontalTabPadding 9px
 
 :root {
   --tabs-top-border-width: 0px;
   --tab-toolbar-navbar-overlap: 1px;
   --tab-min-height: 33px;
+  --tab-min-width: 76px;
   --tab-loading-fill: #0A84FF;
 }
 
 :root[uidensity=compact] {
   --tab-min-height: 29px;
 }
 
 :root[uidensity=touch] {
@@ -47,19 +48,16 @@ tabbrowser {
 
 .tabbrowser-tab {
   -moz-appearance: none;
   background-color: transparent;
   border-radius: 0;
   border-width: 0;
   margin: 0;
   padding: 0;
-}
-
-.tabbrowser-tab {
   -moz-box-align: stretch;
 }
 
 /* The selected tab should appear above the border between the tabs toolbar and
    the navigation toolbar. */
 .tabbrowser-tab[visuallyselected=true] {
   position: relative;
   z-index: 2;