Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bf18b1f243b2076c19b9fe9fbcca7610de274c21
https://github.com/WebKit/WebKit/commit/bf18b1f243b2076c19b9fe9fbcca7610de274c21
Author: Kiet Ho <[email protected]>
Date: 2026-03-19 (Thu, 19 Mar 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic-cross-origin.sub-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic-cross-origin.sub.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/support/light-frame-scrolling.html
M Source/WebCore/page/Frame.cpp
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/LocalFrameView.h
M Source/WebCore/rendering/RenderFrameBase.cpp
M Source/WebCore/rendering/RenderFrameBase.h
M Source/WebCore/rendering/RenderWidget.h
Log Message:
-----------
Changing color-scheme doesn't repaint background of composited iframes
rdar://171658244
https://bugs.webkit.org/show_bug.cgi?id=309097
Reviewed by Alan Baradlay.
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.
As a consequence, if initially the parent and child frame have the same used
color
scheme, then the parent changes its used color scheme, the child frame should
repaint
its background to be opaque. This patch implements this behavior through two
pathways.
1) Child frame lives in the same process as the parent frame: when the parent
frame's
color scheme changes, RenderFrameBase::styleDidChange will directly invalidate
the layout
of the child frame.
2) Child frame lives in a different process (Site Isolation): when the parent
frame's color
scheme changes, it synchronizes its color scheme to other processes using
FrameTreeSyncData
(implemented in 308950@main). When other processes update the parent frame's
FrameTreeSyncData,
we add a hook to invalidate the layout of child frames affected by the new
color scheme.
[1]: https://drafts.csswg.org/css-color-adjust/
Tests:
imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic-cross-origin.sub.html
imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic-cross-origin.sub-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic-cross-origin.sub.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-dynamic.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-color-adjust/rendering/dark-color-scheme/support/light-frame-scrolling.html:
Added.
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::updateFrameTreeSyncData):
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::invalidateForBaseBackgroundOrColorSchemeChange):
(WebCore::LocalFrameView::setBaseBackgroundColor):
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::styleDidChange):
* Source/WebCore/rendering/RenderFrameBase.h:
* Source/WebCore/rendering/RenderWidget.h:
Canonical link: https://commits.webkit.org/309567@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications