Commit c0c9d4da authored by Molly Howell's avatar Molly Howell
Browse files

Bug 1699419 - Consolidate browser toolbar background handling. r=desktop-theme-reviewers,harry

This patch moves code that sets the background of the browser toolbars into
one place. It also removes some non-Proton Windows-only code rather than
updating it for this.

Differential Revision: https://phabricator.services.mozilla.com/D118658
parent 6eb0d4fb
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@ body {
  background-position: var(--lwt-background-alignment);
}

#navigator-toolbox:not(:-moz-lwtheme) {
  background-color: #f0f0f4;
}

/* TODO bug 1695280: Remove these media selectors and merge the rule below
   with the ruleset above. We must set background properties on :root and not
   #navigator-toolbox on Windows 7/8 due to a WebRender bug that hides the
@@ -76,6 +80,9 @@ body {
/* TODO bug 1695280: Remove this block. */
@media (-moz-os-version: windows-win7),
       (-moz-os-version: windows-win8) {
  /* These rules are setting the background for #navigator-toolbox, but they
     also come into play for the rest of the browser in cases when there is no
     other content inside a tab, such as when the customize view is showing. */
  :root:-moz-lwtheme {
    background-color: var(--lwt-accent-color);
    background-image: var(--lwt-additional-images);
@@ -94,6 +101,20 @@ body {
  }
}

/* Disabling DWM compositing is only supported on Windows 7 and Vista. */
@media (-moz-os-version: windows-win7) {
  @media (-moz-windows-compositor: 0) {
    @media (-moz-windows-default-theme) {
      #navigator-toolbox {
        background-color: rgb(185,209,234);
      }
      :root:-moz-window-inactive #navigator-toolbox {
        background-color: rgb(215,228,242);
      }
    }
  }
}

%ifdef MENUBAR_CAN_AUTOHIDE
#toolbar-menubar[autohide="true"] {
  overflow: hidden;
+0 −4
Original line number Diff line number Diff line
@@ -47,10 +47,6 @@
#navigator-toolbox {
  appearance: none;
}

#navigator-toolbox:not(:-moz-lwtheme) {
  background-color: #f0f0f4;
}
} /*** END proton ***/

@media not (-moz-proton) {
+2 −47
Original line number Diff line number Diff line
@@ -44,47 +44,11 @@
  @media not (-moz-os-version: windows-win7) {
    @media not (-moz-os-version: windows-win8) {
      @media (-moz-windows-default-theme) {
        @media not (-moz-proton) {
        :root:not(:-moz-lwtheme) {
          background-color: hsl(0, 0%, 78%);
        }

        @media (-moz-windows-accent-color-in-titlebar: 0) {
          :root[sizemode=normal][tabsintitlebar] {
            border-top: 1px solid rgba(0,0,0,.7);
          }
          :root[sizemode=normal][tabsintitlebar][always-use-accent-color-for-window-border]:not(:-moz-window-inactive) {
            border-top-color: -moz-accent-color;
          }
          :root[tabsintitlebar]:not(:-moz-lwtheme) {
            background-color: hsl(235,33%,19%);
            color: hsl(240,9%,98%);
          }
        }

        @media (-moz-windows-accent-color-in-titlebar) {
          :root[sizemode=normal][tabsintitlebar] {
            border-top: 1px solid -moz-accent-color;
          }
          :root[tabsintitlebar]:not(:-moz-window-inactive, :-moz-lwtheme),
          :root[tabsintitlebar]:not(:-moz-window-inactive)[lwt-default-theme-in-dark-mode] {
            background-color: -moz-accent-color;
            color: -moz-accent-color-foreground;
          }
          :root[tabsintitlebar][lwt-default-theme-in-dark-mode] #titlebar {
            --toolbarbutton-icon-fill: currentColor;
            --toolbarbutton-icon-fill-opacity: .7;
          }
        }
        } /*** end !proton ***/

        @media (-moz-proton) {
        @media (-moz-windows-accent-color-in-titlebar) {
          :root[sizemode=normal][tabsintitlebar] {
            border-top: .5px solid -moz-accent-color;
          }
        }
        } /*** END proton ***/

        :root[sizemode=normal][tabsintitlebar]:-moz-window-inactive {
          border-top-color: rgb(57,57,57);
@@ -96,20 +60,18 @@
          opacity: .6;
        }

        @media (-moz-proton) {
        :root[tabsintitlebar] .tab-secondary-label:-moz-window-inactive {
          opacity: .6;
        }
        } /*** END proton ***/
      }

      @media (-moz-windows-default-theme: 0) {
        :root[tabsintitlebar] {
        :root[tabsintitlebar] #navigator-toolbox {
          appearance: auto;
          -moz-default-appearance: -moz-win-glass;
        }

        :root[tabsintitlebar]:not(:-moz-lwtheme) {
        :root[tabsintitlebar]:not(:-moz-lwtheme) #navigator-toolbox {
          background-color: transparent;
        }

@@ -358,13 +320,6 @@
/* Aero Basic */
@media (-moz-windows-compositor: 0) {
  @media (-moz-windows-default-theme) {
    :root {
      background-color: rgb(185,209,234);
    }
    :root:-moz-window-inactive {
      background-color: rgb(215,228,242);
    }

    /* Render a window top border for lwthemes: */
    #main-window[tabsintitlebar][sizemode="normal"] #navigator-toolbox:-moz-lwtheme {
      background-image: linear-gradient(to bottom,