Bug 1403867 - Fix positioning of indicators when menubar persists. r=johannh, a=ritu
authorYura Zenevich <yura.zenevich@gmail.com>
Tue, 03 Oct 2017 11:38:27 -0400
changeset 432307 120189e6b8b1
parent 432306 fd75995c4d2b
child 432308 a29bc48fe417
push id7929
push userryanvm@gmail.com
push dateMon, 09 Oct 2017 18:47:44 +0000
treeherdermozilla-beta@c4235f5a700c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh, ritu
bugs1403867
milestone57.0
Bug 1403867 - Fix positioning of indicators when menubar persists. r=johannh, a=ritu MozReview-Commit-ID: CycpquSvcl2
browser/base/content/browser.xul
browser/themes/windows/browser.css
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -567,20 +567,16 @@
   </popupset>
   <box id="appMenu-viewCache" hidden="true"/>
 
 #ifdef CAN_DRAW_IN_TITLEBAR
 <vbox id="titlebar">
   <hbox id="titlebar-content">
     <spacer id="titlebar-spacer" flex="1"/>
     <hbox id="titlebar-buttonbox-container">
-#ifdef XP_WIN
-      <button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
-      <hbox class="private-browsing-indicator"/>
-#endif
       <hbox id="titlebar-buttonbox">
         <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
         <toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
         <toolbarbutton class="titlebar-button" id="titlebar-close" command="cmd_closeWindow"/>
       </hbox>
     </hbox>
 #ifdef XP_MACOSX
     <!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -1056,46 +1056,39 @@ notification[value="translation"] {
 #main-window:-moz-any([customize-entering],[customize-exiting]) label {
   transform: perspective(0.01px);
 }
 
 /* End customization mode */
 
 /* Private browsing and accessibility indicators */
 
+:root[sizemode="normal"][chromehidden~="menubar"] #toolbar-menubar ~ #TabsToolbar :-moz-any(.private-browsing-indicator, .accessibility-indicator),
+:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] ~ #TabsToolbar :-moz-any(.private-browsing-indicator, .accessibility-indicator) {
+  margin-top: calc(-1 * var(--space-above-tabbar));
+}
+
+/* Compensate for 4px extra margin on top of the tabs toolbar on Windows 7. */
 @media (-moz-os-version: windows-win7) {
-  /* Making sure that indicators take up all available vertical space. */
-  :root[tabsintitlebar]:not([inFullscreen]) .private-browsing-indicator,
-  :root[tabsintitlebar]:not([inFullscreen]) .accessibility-indicator {
-    height: var(--tab-min-height);
-  }
-
-  :root[tabsintitlebar][sizemode="normal"]:not([inFullscreen]) .private-browsing-indicator,
-  :root[tabsintitlebar][sizemode="normal"]:not([inFullscreen]) .accessibility-indicator {
-    height: calc(var(--tab-min-height) + 4px);
+  :root[sizemode="normal"][chromehidden~="menubar"] #toolbar-menubar ~ #TabsToolbar :-moz-any(.private-browsing-indicator, .accessibility-indicator),
+  :root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] ~ #TabsToolbar :-moz-any(.private-browsing-indicator, .accessibility-indicator) {
+    margin-top: calc(-1 * (var(--space-above-tabbar) + 4px));
   }
 }
 
-:root:-moz-any([tabsintitlebar], [inFullscreen]):not([privatebrowsingmode=temporary]) .accessibility-indicator,
-:root:-moz-any([tabsintitlebar], [inFullscreen]) .private-browsing-indicator {
+:root:not([privatebrowsingmode=temporary]) .accessibility-indicator,
+:root .private-browsing-indicator {
   margin-inline-end: 12px;
 }
 
 :root:not([accessibilitymode]) .private-browsing-indicator,
 .accessibility-indicator {
   margin-inline-start: 12px;
 }
 
-:root[accessibilitymode][tabsintitlebar]:not([inFullscreen]) > #tab-view-deck > #browser-panel > #navigator-toolbox > #TabsToolbar > .accessibility-indicator,
-:root[privatebrowsingmode=temporary][tabsintitlebar]:not([inFullscreen]) > #tab-view-deck > #browser-panel > #navigator-toolbox > #TabsToolbar > .private-browsing-indicator,
-:root[accessibilitymode]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .accessibility-indicator,
-:root[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
-  display: none;
-}
-
 /* End private browsing and accessibility indicators */
 
 %include ../shared/UITour.inc.css
 
 #UITourTooltipButtons {
   /**
    * Override the --arrowpanel-padding so the background extends
    * to the sides and bottom of the panel.