Bug 1397265 - Add a titlebar-placeholder on the right-hand side of the tabs. r=dao, a=ritu
authorJohann Hofmann <jhofmann@mozilla.com>
Thu, 28 Sep 2017 15:20:17 +0200
changeset 434572 53c3484d629196c7ea461cca40df01ce59efa4ba
parent 434571 425fc16c98396fe1d54ff92bd6922c22d44e7aca
child 434573 b6970100a87abc4169a66766001f9ab93d20452c
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, ritu
bugs1397265
milestone57.0
Bug 1397265 - Add a titlebar-placeholder on the right-hand side of the tabs. r=dao, a=ritu MozReview-Commit-ID: 326Nz1XS4lD
browser/base/content/browser.css
browser/base/content/browser.xul
browser/themes/shared/tabs.inc.css
browser/themes/windows/browser.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -235,16 +235,19 @@ window:not([chromehidden~="toolbar"]) #n
  */
 #widget-overflow-list:empty + #widget-overflow-fixed-separator,
 #widget-overflow:not([hasfixeditems]) #widget-overflow-fixed-separator {
   display: none;
 }
 
 
 %ifdef CAN_DRAW_IN_TITLEBAR
+%ifdef MENUBAR_CAN_AUTOHIDE
+#toolbar-menubar:not([autohide=true]) ~ #TabsToolbar > .titlebar-placeholder,
+%endif
 #main-window:not([chromemargin]) > #titlebar,
 #main-window[inFullscreen] > #titlebar,
 #main-window[inFullscreen] .titlebar-placeholder,
 #main-window:not([tabsintitlebar]) .titlebar-placeholder {
   display: none;
 }
 
 #titlebar {
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -629,17 +629,17 @@
              mode="icons"
              iconsize="small"
              aria-label="&tabsToolbar.label;"
              context="toolbar-context-menu"
              collapsed="true">
 
 #ifdef CAN_DRAW_IN_TITLEBAR
       <hbox class="titlebar-placeholder" type="pre-tabs"
-              skipintoolbarset="true"/>
+            skipintoolbarset="true"/>
 #endif
 
       <tabs id="tabbrowser-tabs"
             class="tabbrowser-tabs"
             tabbrowser="content"
             flex="1"
             setfocus="false"
             tooltip="tabbrowser-tab-tooltip"
@@ -676,16 +676,22 @@
           <menu id="alltabs_containersTab"
                 label="&newUserContext.label;">
             <menupopup id="alltabs_containersMenuTab" />
           </menu>
           <menuseparator id="alltabs-popup-separator-2"/>
         </menupopup>
       </toolbarbutton>
 
+#ifdef CAN_DRAW_IN_TITLEBAR
+      <hbox class="titlebar-placeholder" type="post-tabs"
+            ordinal="1000"
+            skipintoolbarset="true"/>
+#endif
+
       <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;"
               ordinal="1000"
               aria-live="polite" skipintoolbarset="true"/>
       <hbox class="private-browsing-indicator" skipintoolbarset="true"
             ordinal="1000"/>
 #ifdef CAN_DRAW_IN_TITLEBAR
       <hbox class="titlebar-placeholder" type="caption-buttons"
             persist="width"
--- a/browser/themes/shared/tabs.inc.css
+++ b/browser/themes/shared/tabs.inc.css
@@ -538,31 +538,25 @@ tabbrowser {
 }
 
 .tab-label[attention]:not([selected="true"]) {
   font-weight: bold;
 }
 
 /* Tab separators */
 
-%ifdef CAN_DRAW_IN_TITLEBAR
-/* Add space for dragging the window */
-%ifdef MOZ_WIDGET_COCOA
-:root[tabsintitlebar]:not([sizemode=fullscreen]) .titlebar-placeholder[type="pre-tabs"]
-%elifdef MENUBAR_CAN_AUTOHIDE
-:root[tabsintitlebar][sizemode=normal] #toolbar-menubar[autohide=true] ~ #TabsToolbar > .titlebar-placeholder[type="pre-tabs"]
-%else
-:root[tabsintitlebar][sizemode=normal] #TabsToolbar > .titlebar-placeholder[type="pre-tabs"]
-%endif
-{
+.titlebar-placeholder[type="pre-tabs"],
+.titlebar-placeholder[type="post-tabs"] {
   width: 40px;
+}
+
+.titlebar-placeholder[type="pre-tabs"] {
   border-inline-end: 1px solid;
   opacity: 0.2;
 }
-%endif
 
 .tabbrowser-tab::after,
 .tabbrowser-tab::before {
   margin-inline-start: -1px;
   border-left: 1px solid;
   /* Vertical margin doesn't work here for positioned pinned tabs, see
      bug 1198236 and bug 1300410. We're using linear-gradient instead
      to cut off the border at the top and at the bottom. */
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -290,20 +290,16 @@
 
 @media (-moz-os-version: windows-win7) {
   /* Preserve window control buttons position at the top of the button box. */
   #titlebar-buttonbox-container {
     -moz-box-align: start;
   }
 }
 
-.titlebar-placeholder[type="caption-buttons"] {
-  margin-left: 22px; /* space needed for Aero Snap */
-}
-
 /* titlebar command buttons */
 
 #titlebar-min {
   -moz-appearance: -moz-window-button-minimize;
 }
 
 #titlebar-max {
   -moz-appearance: -moz-window-button-maximize;