Open Bug 1848145 Opened 1 year ago Updated 1 year ago

Firefox uses Windows theme colors and makes websites ugly if they are altered via external software / the registry.

Categories

(Core :: CSS Parsing and Computation, defect, P3)

Firefox 116
Desktop
Windows
defect

Tracking

()

Tracking Status
firefox117 --- affected
firefox118 --- affected

People

(Reporter: realnurudinimsirovic, Unassigned)

References

Details

Attachments

(4 files)

Attached file Example page to showcase the defect (deleted) —

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0

Steps to reproduce:

Preamble

I am running a heavily modified version of Windows.

The specific issue seems to be related to the theme I'm using that changes the entire color palette of the Windows theme to be completely dark.

Though the fact that my system is modified/patched does not matter, as I've found a way to easily reproduce the issue without 3rd-party tools.


How to reproduce?

  1. Open Registry Editor (C:\windows\system32\regedit.exe)
  2. Navigate to HKCU\Control Panel\Colors
  3. Make a note of the value for Window and WindowText key (you'll need them for backup or else you're gonna be left with an ugly theme)
  4. Set Window to 255 0 0 and WindowText to 0 0 0
  5. Log off and log back on
  6. Open bug.htm that's attached in the ZIP archive.
  7. See that the background is Red and the text is Black (unexpected)
  8. Open that same file in Google Chrome and see that the background is White and the color is Black (expected)

How to revert the theme changes

To fix your Windows theme, simply revert the values back to their defaults (hopefully you took notes of them.)

Actual results:

Firefox uses system theme colors from the registry to assign (default) color values for common controls (background, text, etc)

Here are screenshots comparing Firefox and Google Chrome:

Keep in mind that the page source has not changed at all, both files are exactly the same.

This change is not affected by the theme options within the browser, setting the Light theme in Firefox does not affect this.

Expected results:

The colors of pages should not change based on the theme changes outside of the browser, unless we're talking about the CSS query prefers-color-scheme which is again an optional rule that's specified by the website and not enforced by the web browser.

As a side note, this may also affect other pages that have not defined color properties on their elements.
Some websites appear gray with the black text. It is difficult to find pages that do this, but when they do it's really annoying.

Here's a real website that has this issue. The entire background is red.

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 the issue on Win11x64 using FF build 118.0a1 (august 10th) and doing the settings from description.
Marking issue as new.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Theme → Graphics: Color Management
Ever confirmed: true
OS: Unspecified → Windows
Product: Firefox → Core
Hardware: Unspecified → Desktop
Attached image chrome.png (deleted) —
Attached image firefox.png (deleted) —

Hey there's no CSS bugzilla module?
Gfx team wonders if this is a choice on the part of our CSS default colors with respect to system theme settings?

Component: Graphics: Color Management → CSS Parsing and Computation
Flags: needinfo?(emilio)

Does this repro on a clean profile? Window / WindowText should effectively be spoofed here.

The default background is different tho. browser.display.use_system_colors is controllable from the settings UI and default on on windows here.

The reason we needed this was for HCM to work by default, effectively, see bug 1593273. Tweaking colors via the registry is not a particularly well-supported configuration, but maybe we can change the default back? Morgan, fyi since this is sort of related to the color settings work you are investigating?

Severity: -- → S3
Flags: needinfo?(emilio) → needinfo?(mreschenberg)
Priority: -- → P3
Summary: Firefox uses Windows theme colors and makes websites ugly → Firefox uses Windows theme colors and makes websites ugly if they are altered via external software / the registry.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #8)

Does this repro on a clean profile? Window / WindowText should effectively be spoofed here.

Does this only happen if a user is using standins? I'd have thought we pull the windows colors like we do here.

The reason we needed this was for HCM to work by default, effectively, see bug 1593273. Tweaking colors via the registry is not a particularly well-supported configuration, but maybe we can change the default back? Morgan, fyi since this is sort of related to the color settings work you are investigating?

I think it's important to keep this setting as-is for HCM users. We're doing some work to revamp the color dialog and currently analysing usage of this setting in particular (across all platforms). I'll bookmark this bug as part of that discussion.

Flags: needinfo?(mreschenberg)

does this issue resolve if you uncheck "Use system colors" in about:preferences > Manage colors ?
what if you set ui.use_standins_for_native_colors to true in about:config ?
what happens if you do both of those things ?

Flags: needinfo?(realnurudinimsirovic)

(In reply to Morgan Reschenberg [:morgan] from comment #10)

does this issue resolve if you uncheck "Use system colors" in about:preferences > Manage colors ?
what if you set ui.use_standins_for_native_colors to true in about:config ?
what happens if you do both of those things ?

With Use system colors and ui.use_standins_for_native_colors it successfully solves the problem.
Each website is displaying correct colors so far

Flags: needinfo?(realnurudinimsirovic)
No longer blocks: gfx-triage
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: