Bug 225281

Summary: Implement forced-colors media query
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: max, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Tim Nguyen (:ntim) 2021-05-02 08:41:41 PDT
forced-colors mode is a Windows only accessibility feature, Firefox does allow you to force enable it on other platforms, but for by default it's also mostly for Windows (it's enabled with Windows High contrast mode).

For reference, it forces colors on a webpage to be contrasting, by changing them without the webpage's consent.

Since iOS/macOS has no such thing, so it's reasonable to implement a placeholder where: (forced-colors) or (forced-colors: active) return false and (forced-colors: none) returns true. 

That will allow webpages to use it (since Firefox & Chromium support it), and expect correct results on WebKit.
Comment 1 Tim Nguyen (:ntim) 2021-05-02 08:42:39 PDT
WPT: https://wpt.fyi/results/css/mediaqueries/forced-colors.html
Comment 2 Radar WebKit Bug Importer 2021-05-09 08:42:13 PDT
<rdar://problem/77715265>
Comment 3 Matthieu Dubet 2022-08-09 08:18:51 PDT
Pull request: https://github.com/WebKit/WebKit/pull/3148
Comment 4 EWS 2022-08-10 05:52:24 PDT
Committed 253290@main (46513cc172ce): <https://commits.webkit.org/253290@main>

Reviewed commits have been landed. Closing PR #3148 and removing active labels.