RESOLVED FIXED309097
Changing color-scheme doesn't repaint background of composited iframes
https://bugs.webkit.org/show_bug.cgi?id=309097
Summary Changing color-scheme doesn't repaint background of composited iframes
Kiet Ho
Reported 2026-03-03 13:45:12 PST
Created attachment 478552 [details] Test case See test case. Steps to reproduce: * Open the test case * Click "toggle color-scheme" to switch color-scheme of the main page from light to dark * Observe that the iframe's background is black instead of white. CSS Color Adjustment Module Level 1 [1] dictates that if the used color scheme of the child frame's owner element is different than the used color scheme of the child frame, the background of the child frame must be opaque and not transparent [2]: > In order to preserve expected color contrasts, in the case of embedded documents typically rendered over a transparent canvas (such as provided via an HTML iframe element), if the used color scheme of the element and the used color scheme of the embedded document’s root element do not match, then the UA must use an opaque canvas of the Canvas color appropriate to the embedded document’s used color scheme instead of a transparent canvas. WebKit implemented this in 285606@main [3], but it's a bit incomplete. If color-scheme of the owner element changes, and the child iframe is composited (e.g because of scrolling), then its background doesn't get repainted. It repaints fine if the frame is non-composited. Fixing this might also fix css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-dynamic.html in WPT. [1]: https://drafts.csswg.org/css-color-adjust/ [2]: https://drafts.csswg.org/css-color-adjust/#:~:text=In%20order%20to%20preserve%20expected%20color%20contrasts [3]: https://github.com/WebKit/WebKit/commit/fe5bf113532e9e7753f2ba2c0856bdd097c82f96
Attachments
Test case (973 bytes, text/html)
2026-03-03 13:45 PST, Kiet Ho
no flags
Radar WebKit Bug Importer
Comment 1 2026-03-03 13:45:19 PST
Kiet Ho
Comment 2 2026-03-06 13:26:34 PST
[3] should be 241325@main
Kiet Ho
Comment 3 2026-03-09 18:26:08 PDT
Kiet Ho
Comment 4 2026-03-17 10:44:54 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/58557
EWS
Comment 5 2026-03-19 10:58:44 PDT
Committed 309567@main (bf18b1f243b2): <https://commits.webkit.org/309567@main> Reviewed commits have been landed. Closing PR #60237 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.