1
0
Fork
You've already forked website
0

When to remove the WebKit workaround for insufficient link contrast in dark mode? #55

Open
opened 2024年05月27日 05:55:55 +02:00 by robinmetral · 2 comments
robinmetral commented 2024年05月27日 05:55:55 +02:00 (Migrated from github.com)
Copy link

Links in the default browser dark mode color (using color-scheme) have insufficient contrast on WebKit browsers. This is a known issue.

I worked around it using hardcoded colors for links:

github.com/robinmetral/website@ef779cee5b/templates/page.html (L144-L153)

The bug was fixed on 11.09.2023 (PR) and I attempted to remove the workaround (bc544b0310).

However, testing on a real Safari browser (courtesy of TestGrid), it seems that the issue had not been fixed. (The easiest way to reproduce is to use this Glitch reproduction, since it's a hassle to change the preferred color scheme on remote devices.)

Issue reproduced on Safari 17.2, anchors have insufficient contrast

The device was an iPhone 15 Pro with iOS 17.2.1, using iOS Safari 17.2 (WebKit 617.1.17, according to the MDN mapping).

Questions: in which WebKit/Safari version has the WebKit fix been released? When can we assume that most Safari browsers (90%+) include the fix?

bc544b0310 was reverted for now.


Edit: according to the data below, this will likely take another year.

  • in May 2025, check usage data for Safari <17.4. If it's <25% total Safari usage and <5% total usage, remove the workaround
Links in the default browser dark mode color (using `color-scheme`) have insufficient contrast on WebKit browsers. This is a [known issue](https://bugs.webkit.org/show_bug.cgi?id=209851). I worked around it using hardcoded colors for links: https://github.com/robinmetral/website/blob/ef779cee5bd77712e3be99bfe3b1050890f215ff/templates/page.html#L144-L153 The bug was fixed on 11.09.2023 ([PR](https://github.com/WebKit/WebKit/pull/17512)) and I attempted to remove the workaround (bc544b0310fea1a86095d383bf5aeb455c169468). However, testing on a real Safari browser (courtesy of TestGrid), it seems that the issue had not been fixed. (The easiest way to reproduce is to use [this Glitch reproduction](https://color-scheme-demo.glitch.me/), since it's a hassle to change the preferred color scheme on remote devices.) <img alt="Issue reproduced on Safari 17.2, anchors have insufficient contrast" src="https://github.com/robinmetral/website/assets/35560568/779ba463-ad1e-4539-b09e-383474d8a515" width="250" /> The device was an iPhone 15 Pro with iOS 17.2.1, using iOS Safari 17.2 (WebKit 617.1.17, according to [the MDN mapping](https://github.com/mdn/browser-compat-data/blob/31af7a1bd68e24ce6ce7983f00f8b37555343c99/browsers/safari.json#L286-L292)). Questions: in which WebKit/Safari version has the WebKit fix been released? When can we assume that most Safari browsers (90%+) include the fix? bc544b0310fea1a86095d383bf5aeb455c169468 was reverted for now. --- Edit: according to [the data below](https://github.com/robinmetral/website/issues/55#issuecomment-2132755400), this will likely take another year. - [ ] in May 2025, check usage data for Safari <17.4. If it's <25% total Safari usage and <5% total usage, remove the workaround
robinmetral commented 2024年05月27日 06:14:32 +02:00 (Migrated from github.com)
Copy link

The fix was released in stable Safari 17.4, under WebKit 618.1.15.

The fix was released in [stable Safari 17.4](https://developer.apple.com/documentation/safari-release-notes/safari-17_4-release-notes#Resolved-Issues), under WebKit 618.1.15.
robinmetral commented 2024年05月27日 08:45:16 +02:00 (Migrated from github.com)
Copy link

A rough estimate.

We can extrapolate usage data for specific Safari versions using CanIUse data1 for features that shipped in the target versions.

Safari version Release date CanIUse feature % of total users below version % of Safari users below version
17.4 5 March 2024 Promise.withResolvers 10.332 58.463
17.2 11 December 2023 unprefixed HTMLMediaElement.preservesPitch attribute 6.65 37.63
16.5 18 May 2023 CSS :user-valid selector 4.22 23.88

<25% total Safari usage and <5% total usage seems like an acceptable support policy for this website. We hit it when going back to Safari <16.5.

Since 16.5 was released about a year ago, it'll likely take another year until Safari <17.4 meets the policy.

Conclusion: I'm keeping the workaround around until at least May 2025.


  1. Current CanIUse estimates are based on the April release of StatCounter GlobalStats ↩︎

  2. desktop version global usage + iOS version global usage ↩︎

  3. version global usage * 100 / global Safari usage (17.67%) ↩︎

A rough estimate. We can extrapolate usage data for specific Safari versions using CanIUse data[^1] for features that shipped in the target versions. | Safari version | Release date | CanIUse feature | % of total users below version | % of Safari users below version | |--------|--------|--------|--------|--------| | [17.4](https://developer.apple.com/documentation/safari-release-notes/safari-17_4-release-notes) | 5 March 2024 | [Promise.withResolvers](https://caniuse.com/mdn-javascript_builtins_promise_withresolvers) | 10.33[^2] | 58.46[^3] | | [17.2](https://developer.apple.com/documentation/safari-release-notes/safari-17_2-release-notes) | 11 December 2023 | [unprefixed HTMLMediaElement.preservesPitch attribute](https://caniuse.com/mdn-api_htmlmediaelement_preservespitch) | 6.65 | 37.63 | | [16.5](https://developer.apple.com/documentation/safari-release-notes/safari-16_5-release-notes) | 18 May 2023 | [CSS :user-valid selector](https://caniuse.com/mdn-css_selectors_user-valid) | 4.22 | 23.88 | \<25% total Safari usage and <5% total usage seems like an acceptable support policy for this website. We hit it when going back to Safari <16.5. Since 16.5 was released about a year ago, it'll likely take another year until Safari <17.4 meets the policy. **Conclusion: I'm keeping the workaround around until at least May 2025.** [^1]: Current CanIUse estimates are based on the April release of [StatCounter GlobalStats](http://gs.statcounter.com/) [^2]: desktop version global usage + iOS version global usage [^3]: version global usage * 100 / global Safari usage (17.67%)
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robinmetral/website#55
Reference in a new issue
robinmetral/website
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?