Bug 309611

Summary: @prefers-color-scheme doesn't see color-scheme from grandparent frames and above
Product: WebKit Reporter: Kiet Ho <kiet.ho>
Component: Layout and RenderingAssignee: Kiet Ho <kiet.ho>
Status: NEW    
Severity: Normal CC: bfulgham, kiet.ho, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=284973
Attachments:
Description Flags
Test case 1 none

Kiet Ho
Reported 2026-03-10 16:35:12 PDT
Created attachment 478621 [details] Test case 1 See the test case. We have an <iframe> (iframe 1) with color-scheme: dark. The inside document has another <iframe> (iframe 2) without color-scheme. The innermost document has a box which its background-color depends on @prefers-color-scheme. The color-scheme from iframe 1 should propagate through iframe 2 into the innermost document, so prefers-color-scheme should match "dark". But in WebKit, it doesn't match to "dark". On Chrome 147.0.7719.3 (Official Build) dev (arm64) and Firefox 150.0a1 (2026-03-10) (aarch64), the box is dark blue, regardless of environment color scheme. In WebKit, the box is light blue instead.
Attachments
Test case 1 (488 bytes, text/html)
2026-03-10 16:35 PDT, Kiet Ho
no flags
Radar WebKit Bug Importer
Comment 1 2026-03-10 16:35:19 PDT
Kiet Ho
Comment 2 2026-03-10 16:38:16 PDT
To add, this is found when investigating bug 284973.
Note You need to log in before you can comment on or make changes to this bug.