Skip to content

Commit

Permalink
Bug 1843663 - Remove pre windows-10-specific media queries and styles…
Browse files Browse the repository at this point in the history
…. r=dao,Gijs,handyman,settings-reviewers

Some basic clean-up. I want to do this before doing bigger changes in
bug 1843044.

There's tons more code that can get cleaned-up on the widget side, but
let's start with this.

Differential Revision: https://phabricator.services.mozilla.com/D183622
  • Loading branch information
emilio committed Jul 18, 2023
1 parent 51bbef2 commit 7e60f84
Show file tree
Hide file tree
Showing 33 changed files with 360 additions and 1,654 deletions.
49 changes: 9 additions & 40 deletions browser/base/content/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,50 +77,19 @@ body {
background-image: var(--lwt-additional-images);
background-repeat: var(--lwt-background-tiling);
background-position: var(--lwt-background-alignment);
background-color: var(--lwt-accent-color);
}

/* 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
minimize/maximize/close buttons. */
@media not (-moz-platform: windows-win7) {
@media not (-moz-platform: windows-win8) {
#navigator-toolbox:-moz-lwtheme {
background-color: var(--lwt-accent-color);
}

/* When a theme defines both theme_frame and additional_backgrounds, show
the latter atop the former. */
:root[lwtheme-image] #navigator-toolbox {
background-image: var(--lwt-header-image), var(--lwt-additional-images);
background-repeat: no-repeat, var(--lwt-background-tiling);
background-position: right top, var(--lwt-background-alignment);
}

#navigator-toolbox:-moz-window-inactive:-moz-lwtheme {
background-color: var(--lwt-accent-color-inactive, var(--lwt-accent-color));
}
}
/* When a theme defines both theme_frame and additional_backgrounds, show
the latter atop the former. */
:root[lwtheme-image] #navigator-toolbox {
background-image: var(--lwt-header-image), var(--lwt-additional-images);
background-repeat: no-repeat, var(--lwt-background-tiling);
background-position: right top, var(--lwt-background-alignment);
}
/* TODO bug 1695280: Remove this block. */
@media (-moz-platform: windows-win7),
(-moz-platform: windows-win8) {
:root:-moz-lwtheme {
background-color: var(--lwt-accent-color);
background-image: var(--lwt-additional-images);
background-repeat: var(--lwt-background-tiling);
background-position: var(--lwt-background-alignment);
}

:root[lwtheme-image] {
background-image: var(--lwt-header-image, linear-gradient(transparent, transparent)), var(--lwt-additional-images) !important;
background-repeat: no-repeat, var(--lwt-background-tiling);
background-position: right top, var(--lwt-background-alignment) !important;
}

:root:-moz-lwtheme:-moz-window-inactive {
background-color: var(--lwt-accent-color-inactive, var(--lwt-accent-color));
}
#navigator-toolbox:-moz-window-inactive:-moz-lwtheme {
background-color: var(--lwt-accent-color-inactive, var(--lwt-accent-color));
}

#titlebar {
Expand Down
7 changes: 1 addition & 6 deletions browser/base/content/test/forms/browser_selectpopup_large.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,7 @@ async function performLargePopupTests(win) {
// might return floating point values. We don't care about sub-pixel
// accuracy, and only care about the final pixel value, so we add a
// fuzz-factor of 1.
//
// FIXME(emilio): In win7 scroll position is off by 20px more, but that's
// not reproducible in win10 even with the win7 "native" menus enabled.
const fuzzFactor = matchMedia("(-moz-platform: windows-win7)").matches
? 21
: 1;
const fuzzFactor = 1;
SimpleTest.isfuzzy(
selectPopup.children[selectedOption].getBoundingClientRect().bottom,
selectPopup.getBoundingClientRect().bottom - bpBottom + marginBottom,
Expand Down
7 changes: 1 addition & 6 deletions browser/base/content/test/static/browser_parsable_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,7 @@ let customPropsToReferencesMap = new Map();
function neverMatches(mediaList) {
const perPlatformMediaQueryMap = {
macosx: ["(-moz-platform: macos)"],
win: [
"(-moz-platform: windows)",
"(-moz-platform: windows-win7)",
"(-moz-platform: windows-win8)",
"(-moz-platform: windows-win10)",
],
win: ["(-moz-platform: windows)"],
linux: ["(-moz-platform: linux)"],
android: ["(-moz-platform: android)"],
};
Expand Down
101 changes: 0 additions & 101 deletions browser/themes/shared/light-dark-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,104 +7,3 @@
--urlbar-box-focus-bgcolor: var(--button-bgcolor);
--urlbar-box-hover-bgcolor: var(--button-hover-bgcolor);
}

@media (-moz-platform: windows) {
/* The window background is white due to no accentcolor in the lightweight
theme. It can't be changed to transparent when there is no compositor
(Win 7 in classic / basic theme), or else dragging and focus become
broken. So instead just show the normal titlebar in that case, and override
the window color as transparent when the compositor is available. */
@media (-moz-windows-compositor: 0) {
:root[tabsintitlebar]:not([inDOMFullscreen]) #titlebar:-moz-lwtheme {
visibility: visible;
}

/* Prevent accent color overriding the window background for
* light and dark theme on Aero Basic. This is copied from browser-aero.css. */
@media (-moz-windows-default-theme) {
:root {
background-color: rgb(185,209,234) !important;
}
:root:-moz-window-inactive {
background-color: rgb(215,228,242) !important;
}
}
}

/* Add a fog for background tabs to be visible on Windows 7 glass window background */
@media (-moz-platform: windows-win7) {
@media (-moz-windows-default-theme) {
#TabsToolbar {
background-image: radial-gradient(ellipse at bottom, rgba(255,255,255,0.8), rgba(255,255,255,0.5) 80%, transparent);
color: black;
--toolbarbutton-icon-fill: currentColor;
}
}
}

@media (-moz-windows-glass) {
/* Make the menubar text readable on aero glass (copied from browser-aero.css). */
#toolbar-menubar {
text-shadow: 0 0 .5em white, 0 0 .5em white, 0 1px 0 rgba(255,255,255,.4);
}

#main-menubar:not(:-moz-window-inactive) {
background-color: rgba(255,255,255,.5);
color: black;
border-radius: 4px;
}
}

@media (-moz-platform: windows-win7),
(-moz-platform: windows-win8) {
@media (-moz-windows-compositor) {
:root {
background: transparent !important;
}

/* Remove lwtheme borders from toolbars in non-maximized windows. */
#toolbar-menubar,
#TabsToolbar {
border-inline-style: none !important;
}
}

/* Use proper menu text styling in Win7 classic mode. On Windows 8, we use
these colors so tabs and menus are legible against the window accent color.
These colors are copied from browser.css. */
@media (-moz-windows-compositor: 0),
(-moz-windows-default-theme: 0),
(-moz-platform: windows-win8) {
:root[tabsintitlebar] {
color: CaptionText;
}

:root[tabsintitlebar]:-moz-window-inactive {
color: InactiveCaptionText;
}
}
}

/* Restored windows get an artificial border on windows, because the lwtheme background
* overlaps the regular window border. That isn't the case for us, so we avoid painting
* over the native border with our custom borders. These are !important to avoid
* specificity-wars with the selectors that add these borders. */
@media (-moz-windows-classic),
(-moz-windows-compositor: 0) and (-moz-windows-default-theme) {
#navigator-toolbox {
background-image: none !important;
}
}
@media (-moz-windows-glass) {
#navigator-toolbox {
border-top: none !important;
box-shadow: none !important;
padding-top: 0 !important;
}
}
@media (-moz-platform: windows-win8) {
#navigator-toolbox {
border-top: none !important;
}
}
}
8 changes: 0 additions & 8 deletions browser/themes/shared/preferences/preferences.css
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,6 @@ a[is="moz-support-link"]:not(.sidebar-footer-link) {
margin-inline-start: 0;
}

@media (-moz-platform: windows-win7),
(-moz-platform: windows-win8) {
#windows-sso,
#windows-sso-caption {
display: none;
}
}

/**
* Dialog
*/
Expand Down
2 changes: 1 addition & 1 deletion browser/themes/shared/searchbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
fill-opacity: var(--urlbar-icon-fill-opacity);
}

@media (-moz-platform: windows-win10) {
@media (-moz-platform: windows) {
#PopupSearchAutoComplete {
--panel-border-radius: var(--arrowpanel-border-radius);
}
Expand Down
Loading

0 comments on commit 7e60f84

Please sign in to comment.