Infer prefers-contrast preference from the contrast between forced colors
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
People
(Reporter: zekemedley, Unassigned)
Details
(Whiteboard: [layout:backlog])
Per https://github.com/w3c/csswg-drafts/issues/5224#issuecomment-667206376 we should infer contrast preferences from forced colors if colors are being forced.
As far as what thresholds we should choose I think there is room for a good discussion. When we first implemented prefers-contrast
we used the WCAG guidelines but later removed it from the patch(see line 275 of nsMediaFeatures.cpp
).
I think those thresholds are reasonable, but likely aren't quite extreme enough. Windows high contrast themes force colors that are much higher than those thresholds. We wan't to be careful not to cast too wide a net and catch people who are forcing colors for non-a11y reasons.
Updated•5 years ago
|
Comment 1•4 years ago
•
|
||
I just spoke with Alison Maher, the prefers-contrast dev on Edge. We decided 7:1 for 'more' and 2.5:1 for 'less' feel appropriate. The "high" threshold would encompass all windows HCM themes as well as the FF-default HCM theme. RE: last week's TPAC planning meeting (& discussion with heycam), this is the last major change to prefers-contrast that we'd need to make before asking for the CSSWG's blessing to ship & un-pref'ing.
:sean is this something that could be prioritized? Asa and I met with google a11y folks a few weeks back and they've got a vested interest in us un-pref'ing this so they can do HCM compat testing in Firefox. (ni'ing emilio here too since he'd probably be the one to take this on)
Comment 2•4 years ago
|
||
I'm still a bit skeptic of the utility of this, but...
Curious, 7:1 and 2.5:1 of what colors in particular? Canvas
and Text
I guess? Something else?
But this should be relatively straight-forward to implement in Gecko_MediaFeatures_PrefersContrast
...
Comment 3•4 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)
I'm still a bit skeptic of the utility of this, but...
Curious, 7:1 and 2.5:1 of what colors in particular?
Canvas
andText
I guess? Something else?But this should be relatively straight-forward to implement in
Gecko_MediaFeatures_PrefersContrast
...
Yep, foreground/background colors (so text vs. canvas). Right now our prefers-contrast implementation treats "forced" and "more" as the same, and does nothing for "less". This change would separate those buckets so users preferring low-contrast won't receive stylised high-contrast pages.
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Tagging bug 1626679 here since it can probably be done at the same time as this one :)
Comment 5•3 years ago
|
||
Bug 1656363 does this.
Updated•3 years ago
|
Description
•