Bug 225281 - Implement forced-colors media query
Summary: Implement forced-colors media query
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-02 08:41 PDT by Tim Nguyen (:ntim)
Modified: 2022-08-10 05:52 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.