Introduce Contrast Control Settings
Categories
(Firefox :: Disability Access, enhancement)
Tracking
()
People
(Reporter: eeejay, Assigned: eeejay)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
The colors section in preferences has been around in one form or another since early web days. It was originally meant to change the colors used in web pages, and precedes CSS. It is very uncommon in on the web today to encounter unstyled content. The ability to change the default colors without high contrast mode does not offer a good experience. Let's rededicate this section to contrast control and offer a straightforward way for users to toggle high contrast and tune it to their needs.
Assignee | ||
Comment 1•1 year ago
|
||
This patch changes the backing prefs by removing
browser.display.use_system_colors and relying on the tristate offered
by browser.display.document_color_use. This simplifies the color
decision tree.
The UI changes are a rough draft of what the preferences could look
like.
Assignee | ||
Comment 2•1 year ago
|
||
Attached above is a WIP. I'm curious if you think this is approach is worthy and something I should refine. To get a quick idea of what I did, I would just look at PreferenceSheet.cpp
, the doc changes also give a high level overview. You can also try it :)
Comment 3•1 year ago
|
||
So not opposed to this in principle, but this changes our behavior on Linux and macOS to default to system colors, which I don't think it'll be web compatible. In particular, on light mode, Canvas
should be white by default and CanvasText
black, otherwise you risk silly compatibility issues...
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 4•1 year ago
|
||
The browser.*
color prefs need to be rededicated to HCM exclusively. we should not read those in non HCM mode. we can't use system colors in non-hcm because of Canvas/CanvasText quirks in MacOS. We also cannot use standins because they do not respect system theming for things like accent color. I propose we use a subset of the standins for fg/bg/link/visited.
I refactored PreferenceSheet::Prefs::LoadColors
to have 3 branches for color loading
- no-hcm OR use standins: Use the standin colors for text/bg and link/visited. This changes the current behavior in windows where those colors are retrieved from the system even in non-hcm mode. i don't think this is an issue.
- hcm explicitly on: use pref colors
- hcm on via OS settings: use system colors
Comment 5•1 year ago
|
||
I think I'd expect HCM explicitly on to use system colors? At least when in high contrast mode...
Assignee | ||
Comment 6•1 year ago
|
||
When I say "hcm explicitly on" I mean turning on HCM in Firefox's settings, regardless of OS settings. So in that case we use Firefox's pref colors. If the firefox HCM settings are in "auto", and the OS has HCM, use the system colors.
Comment 7•1 year ago
|
||
Yeah, but if the OS has HCM, and HCM is explicitly on, then we should probably still use system colors?
Assignee | ||
Comment 8•1 year ago
|
||
Maybe a better description of these options is "Auto", "Off" and "Custom". The last one turns on HCM explicitly with colors customized in the browser. This allows users finer grained control over the palette. A use case for that would be Mac or Linux users who get a sub-optimal palette from the OS's HCM and want to use a better one in the browser, or a Windows HCM user who might want finer grained control for web content.
Just like right now, Linux and Mac would have "Off" by default, and Windows "Auto".
Comment 9•1 year ago
|
||
I'm a fan of this :) thanks for working on it !
Comment 10•1 year ago
|
||
Newer versions of MacOS reworked the system contrast settings.
Increase contrast now takes light colors, and lightens them more. So if you needed to make outlines, edges, etc. bolder and more visible, it makes them fainter and eventually invisible.
I don't think Firefox should require certain system contrast settings.
Assignee | ||
Comment 11•1 year ago
|
||
(In reply to MarjaE from comment #10)
Newer versions of MacOS reworked the system contrast settings.
Increase contrast now takes light colors, and lightens them more. So if you needed to make outlines, edges, etc. bolder and more visible, it makes them fainter and eventually invisible.
I don't think Firefox should require certain system contrast settings.
The change here allows you to control the contrast settings and colors in Firefox regardless of system palette and preferences. The idea being that this is a very subjective area and web content can behave in all kinds of ways so the user needs better control than simply the OS settings.
Updated•9 months ago
|
Updated•9 months ago
|
Updated•8 months ago
|
Comment 12•8 months ago
|
||
Comment 13•8 months ago
|
||
Backed out for causing ba failures @ browser_attributed_text.js
- Backout link
- Push with failures
- Failure Log
- Failure line:
TEST-UNEXPECTED-FAIL | accessible/tests/browser/mac/browser_attributed_text.js | [["hello ","#000000","#ffffff","undefined","undefined",1,32,null,"undefined"],["world","#0066cc","#ffffff",1,"#0066cc",1,32,"a1","undefined"],["this ","#000000","#ffffff","undefined","undefined","undefined",16,null,"undefined"],["is","#ff0000","#ffff00","undefined","undefined","undefined",16,null,1],[" ","#000000","#ffffff","undefined","undefined","undefined",16,nu
Assignee | ||
Updated•8 months ago
|
Comment 14•8 months ago
|
||
Comment 15•8 months ago
|
||
bugherder |
Assignee | ||
Comment 16•8 months ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: This revamps a 30 year old feature and adapts it to the modern web.
[Affects Firefox for Android]: No
[Suggested wording]: Rededicate old Colors settings to Contrast Control settings.
[Links (documentation, blog post, etc)]: https://blog.monotonous.org/2025/03/06/New-Contrast-Control-Settings/
Comment 17•7 months ago
|
||
Added to 138 nightly release notes and is on track for the final 138 release notes.
Assignee | ||
Comment 18•7 months ago
|
||
SUMO article request: https://bugzilla.mozilla.org/show_bug.cgi?id=1957704
Comment 19•11 days ago
|
||
@eeejay Does browser.display.use_system_colors
still remains in the static preference list for Thunderbird and Seamonkey only? As far as I can tell, it is no longer used in Firefox, is that correct?
Assignee | ||
Comment 20•11 days ago
|
||
That is correct. They should probably be removed there.
Assignee | ||
Comment 21•11 days ago
|
||
Oh, I see it is in mozilla-central.. it should probably be removed as a followup, yes.
Description
•