Bug 316680

Summary: iframes don't respect the color-scheme CSS property of the parent document.
Product: WebKit Reporter: Oliver Williams <oliverwilliams345>
Component: Layout and RenderingAssignee: Kiet Ho <kiet.ho>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, bfulgham, karlcow, kiet.ho, michael, rik, simon.fraser, webkit-bug-importer, woodlxf00, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: visionOS 26   
See Also: https://bugs.webkit.org/show_bug.cgi?id=284973
Attachments:
Description Flags
Test code for the iframe none

Oliver Williams
Reported 2026-06-09 10:45:07 PDT
If test.html contains either <meta name="color-scheme" content="dark light" /> or the following CSS :root { color-scheme: light dark; } then the following should render differently. <iframe style="color-scheme: light;" src="test.html" frameborder="0"></iframe> <iframe style="color-scheme: dark;" src="test.html" frameborder="0"></iframe> This already works properly in Firefox and Chrome/Edge. color-scheme should effect: - prefers-color-scheme media query (this works in Safari Technology Preview already! ✅) - Canvas, CanvasText, and other system color keywords. ❌ - Any uses of the CSS light-dark() function. ❌ - scrollbars ❌
Attachments
Test code for the iframe (701 bytes, text/html)
2026-06-09 11:51 PDT, Oliver Williams
no flags
Oliver Williams
Comment 1 2026-06-09 11:51:34 PDT
Created attachment 480028 [details] Test code for the iframe
Radar WebKit Bug Importer
Comment 2 2026-06-09 18:21:11 PDT
Kiet Ho
Comment 3 2026-06-09 18:27:04 PDT
Note You need to log in before you can comment on or make changes to this bug.