Closed Bug 1658796 Opened 5 years ago Closed 3 years ago

Infer prefers-contrast preference from the contrast between forced colors

Categories

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

defect

Tracking

()

RESOLVED DUPLICATE of bug 1656363

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.

Severity: -- → S3

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)

Flags: needinfo?(svoisen)
Flags: needinfo?(emilio)

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...

Flags: needinfo?(emilio)

(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 and Text 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.

Flags: needinfo?(svoisen)
Priority: -- → P2
Whiteboard: [layout:backlog]
See Also: → 1626679

Tagging bug 1626679 here since it can probably be done at the same time as this one :)

Depends on: 1737438

Bug 1656363 does this.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
No longer blocks: 1656363
No longer depends on: 1737438
See Also: 1626679
You need to log in before you can comment on or make changes to this bug.