Closed Bug 1789214 Opened 2 years ago Closed 1 year ago

prefers-color-scheme is not updated according to the selected high contrast theme

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 103
defect

Tracking

()

VERIFIED FIXED
121 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 --- wontfix
firefox-esr115 --- wontfix
firefox104 --- wontfix
firefox105 --- wontfix
firefox106 --- wontfix
firefox119 --- wontfix
firefox120 --- wontfix
firefox121 --- verified

People

(Reporter: simon.lenz, Assigned: emilio)

References

Details

Attachments

(4 files)

Steps to reproduce:

  1. Enable windows High-Contrast mode with the theme "High Contrast Black"
  2. Firefox's appearance setting "System Theme"
  3. Look at https://codepen.io/simondl/pen/oNdgpdE in Firefox

Notes:

Actual results:

Div (1) spans the whole width.
Div (2) is narrow.
Div (3) spans the whole width.

Expected results:

Div (1) is narrow.
Div (2) is narrow.
Div (3) is narrow.

The Bugbug bot thinks this bug should belong to the 'Firefox::Theme' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Theme

I was able to reproduce this issue in all versions of Firefox using the https://codepen.io/simondl/pen/oNdgpdE test case.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Component: Theme → CSS Parsing and Computation
Flags: needinfo?(emilio)
Product: Firefox → Core
Attached file Test case

Here's a test case that tries to invert a white SVG icon to be black if we determine that the background is light.

Attachment #9361480 - Attachment mime type: text/plain → text/html

We might want to do this more generally at the PreferencesSheet level
all the times we're forcing colors, but this should be uncontroversial
and fix the default behavior.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

This requires moving some code around to PreferenceSheet, but that makes
stuff actually a bit simpler.

Need to add a test for this.

Depends on D192574

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c25f6d823433 In Windows HCM, derive system color-scheme from the HCM theme background. r=win-reviewers,mhowell https://hg.mozilla.org/integration/autoland/rev/bdfe284b7ab1 When forcing colors without a color-scheme, compute prefers-color-scheme based on them. r=morgan https://hg.mozilla.org/integration/autoland/rev/5f1ebbf34671 apply code formatting via Lando
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch

Verified as fixed in our latest Nightly build 121.0a1 (2023-11-07).

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox120 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Let's let this ride the trains.

Flags: needinfo?(emilio)

Updating the main status flag for this issue.

Status: RESOLVED → VERIFIED
Regressions: 1879386
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: