Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: af8b3f0e11eb391e2bc4565b269b842eff2e9c72
https://github.com/WebKit/WebKit/commit/af8b3f0e11eb391e2bc4565b269b842eff2e9c72
Author: Ben Nham <[email protected]>
Date: 2026-09-17 (Thu, 17 Sep 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-frame-geometry-while-scrolling-expected.txt
A
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-frame-geometry-while-scrolling.html
M Source/WebCore/page/FrameGeometrySyncData.cpp
M Source/WebCore/page/FrameGeometrySyncData.h
M Source/WebCore/page/FrameTreeSyncData.in
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/Page.h
M Source/WebCore/page/RemoteFrameView.cpp
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
Log Message:
-----------
[Site Isolation] Move layoutViewportRect out of FrameGeometry
https://bugs.webkit.org/show_bug.cgi?id=324313
rdar://problem/187545161
Reviewed by Kiet Ho.
This moves layoutViewportRect out of the FrameGeometry message and into a new
FrameViewportInfo
message. The FrameViewportInfo message contains both layoutViewportRect and
scrollPosition.
The basic idea is that most of the fields in FrameGeometry don't change while
scrolling. However,
layoutViewportRect generally does change on every scroll tick, since it is in
document coordinates
with an origin that changes with the scroll position. In order to make the
optimization in
321103@main more effective (which avoids rebroadcasting FrameGeometry if it
hasn't changed), we need
to remove frequently changing values like layoutViewportRect from FrameGeometry.
In order to do this:
1. LocalFrameView::scrollPositionChanged now defers sending the scroll position
by scheduling a
rendering update step.
2. After the rendering update, Page::syncLocalFrameInfoToRemote runs. This
broadcasts the new
FrameViewportInfo message containing both the scroll position from (1) and
layoutViewportRect.
This also fixes an existing issue where an updated FrameScrollPosition isn't
sent to newly created
frames, which is tested via some color picker tests.
Tests: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
http/tests/site-isolation/do-not-rebroadcast-frame-geometry-while-scrolling.html
*
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-frame-geometry-while-scrolling-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-frame-geometry-while-scrolling.html:
Added.
* Source/WebCore/page/FrameGeometrySyncData.cpp:
(WebCore::operator==):
(WebCore::operator<<):
* Source/WebCore/page/FrameGeometrySyncData.h:
* Source/WebCore/page/FrameTreeSyncData.in:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::scrollPositionChanged):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::syncLocalFrameInfoToRemote):
(WebCore::Page::doAfterUpdateRendering):
(WebCore::operator<<):
* Source/WebCore/page/RemoteFrameView.cpp:
(WebCore::RemoteFrameView::layoutViewportRect):
(WebCore::RemoteFrameView::layoutViewportRect const):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::calculateFrameTreeSyncData):
(WebKit::WebFrameProxy::calculateFrameTreeSyncData const):
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
(WebKit::WebLocalFrameLoaderClient::broadcastFrameTreeSyncDataToOtherProcesses):
(WebKit::WebLocalFrameLoaderClient::clearLastBroadcastFrameTreeSyncData):
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.h:
(WebKit::WebLocalFrameLoaderClient::clearLastBroadcastFrameTreeSyncData):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::frameTreeSyncDataChangedInAnotherProcess):
(WebKit::WebPage::allFrameTreeSyncDataChangedInAnotherProcess):
* Source/WebCore/page/Page.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::(SiteIsolation, ColorInputPickerLocationInCrossSiteIframe)):
(TestWebKitAPI::(SiteIsolation,
ColorInputPickerLocationInScrolledCrossSiteIframe)):
(TestWebKitAPI::(SiteIsolation,
ColorInputPickerLocationInDelayLoadedCrossSiteIframe)):
Canonical link: https://commits.webkit.org/321367@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications