Bug 261149

Summary: Navigating away from a meta color-scheme dark page causes dark background color on target page
Product: WebKit Reporter: Markus Dosch <mail>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: akeerthi, simon.fraser, timothy
Priority: P2    
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
URL: https://markusdosch.github.io/webkit-bug-meta-color-scheme-dark/

Description Markus Dosch 2023-09-05 05:40:51 PDT
Scenario:

- Originating page A sets <meta name="color-scheme" content="dark" />
- Target page B does not set a color-scheme, and does not set a background-color

When navigating from A to B via a link, the expectation is: The background on B should be white.

Actual result: Target page has a dark background, making the text illegible.

The issue also occurs if the target page explicitly sets color-scheme to light. The issue did only occur when both pages were on the same domain, I could not reproduce it for cross-domain linking.

Demo: https://markusdosch.github.io/webkit-bug-meta-color-scheme-dark/

Chrome & Firefox behave as expected and always show the target page with a white background.
Comment 1 Aditya Keerthi 2023-09-05 13:06:05 PDT
Does this reproduce for you in STP? I'm unable to reproduce with Safari 17 (beta).
Comment 2 Aditya Keerthi 2023-09-05 13:06:44 PDT
STP (Safari Technology Preview): https://developer.apple.com/safari/technology-preview/
Comment 3 Markus Dosch 2023-09-05 13:31:24 PDT
Thanks for your fast response! I just installed & checked with Safari Technology Preview - indeed, I can't reproduce it there! 

So it seems it will be fixed in Safari 17 (right?) :)
Comment 4 Aditya Keerthi 2023-09-05 13:33:54 PDT
It should be! Though the change that would have fixed this does not obviously come to mind 😅