Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bd7861b451f226a255358c8310321eae3e6c88f8
https://github.com/WebKit/WebKit/commit/bd7861b451f226a255358c8310321eae3e6c88f8
Author: Ben Nham <[email protected]>
Date: 2026-09-04 (Fri, 04 Sep 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-3d-transformed-expected.txt
A
LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-3d-transformed.html
A
LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-expected.txt
A
LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-nested-expected.txt
A LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-nested.html
A LayoutTests/http/tests/site-isolation/ios/exposed-content-rect.html
A
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-3d-transformed-cross-origin-iframe-expected.txt
A
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-3d-transformed-cross-origin-iframe.html
A
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-cross-origin-iframe-expected.txt
A
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-cross-origin-iframe.html
A
LayoutTests/http/tests/site-isolation/resources/frame-geometry-child-cross-site.html
A
LayoutTests/http/tests/site-isolation/resources/frame-geometry-frame-with-same-site-child.html
A LayoutTests/http/tests/site-isolation/resources/frame-geometry-frame.html
A
LayoutTests/http/tests/site-isolation/resources/frame-geometry-grandchild-same-site.html
A LayoutTests/http/tests/site-isolation/resources/frame-geometry-reporter.js
A LayoutTests/http/tests/site-isolation/resources/frame-geometry-test.js
M
LayoutTests/http/tests/site-isolation/resources/request-animation-frame-throttling-frame.html
A
LayoutTests/http/tests/site-isolation/window-clip-rect-3d-transformed-expected.txt
A LayoutTests/http/tests/site-isolation/window-clip-rect-3d-transformed.html
A LayoutTests/http/tests/site-isolation/window-clip-rect-expected.txt
A LayoutTests/http/tests/site-isolation/window-clip-rect-nested-expected.txt
A LayoutTests/http/tests/site-isolation/window-clip-rect-nested.html
A LayoutTests/http/tests/site-isolation/window-clip-rect.html
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/page/FrameTree.h
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/LocalFrameView.h
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/RemoteFrameLayoutInfo.cpp
M Source/WebCore/page/RemoteFrameLayoutInfo.h
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
Log Message:
-----------
[Site Isolation] Change coordinate space for cross-process frame geometry
https://bugs.webkit.org/show_bug.cgi?id=323375
rdar://problem/186609673
Reviewed by Alex Christensen.
In 318269@main and 319536@main, we introduced new fields in
RemoteFrameLayoutInfo in order to fix
the way exposedContentRect (which controls tile coverage) and windowClipRect
(which controls various
visibility-based heuristics like hidden frame throttling) work in remote frames.
There are two problems with these fields:
1. windowClipRectInParent is the viewport in the parent frame's content
coordinate space, so it
changes on every frame when the parent frame scrolls. We don't want these
values to change on
every frame. Instead, they should only change when necessary (like when the
remote frame
intersects the edges of the viewport). This allows us to make future perf
optimizations to avoid
sending a FrameGeometry IPC if it matches a previously sent value.
2. On the receiver side, we bailed out of mapping the rects into the remote
frame's view space for
any non-affine transform, causing us to fall back to non-optimal fallback
behavior for remote
frames with 3D transforms (e.g. tiling the entire frame and never throttling
it).
To address this, this patch makes it so that on the sender side,
Page::syncLocalFrameInfoToRemote
now sends rects in the child frame's view coordinate space instead of the
parent frame's content
coordinate space. This is accomplished via a new
mapAbsoluteToChildFrameViewRect function in
LocalFrameView, which uses projectQuad rather than mapRect so that the
non-affine case works.
On the receiver side, we no longer need to map the rect into our own view
coordinate space, so we
can just intersect the rects with the frame's size and use them directly as
inputs into the
exposedContentRect and windowClipRect computations.
Most of these paths had very little testing, so I added tests for both
exposedContentRect and
windowClipRect which check that these values are correct for both same-site and
cross-site iframes.
This needed new internals accessors for both rects, plus
delegatesScrollingToNativeView, since
whether a clip rect in window coordinates has had the scroll position taken out
of it differs
between macOS and iOS.
Tests: http/tests/site-isolation/ios/exposed-content-rect-3d-transformed.html
http/tests/site-isolation/ios/exposed-content-rect-nested.html
http/tests/site-isolation/ios/exposed-content-rect.html
http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-3d-transformed-cross-origin-iframe.html
http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-cross-origin-iframe.html
http/tests/site-isolation/window-clip-rect-3d-transformed.html
http/tests/site-isolation/window-clip-rect-nested.html
http/tests/site-isolation/window-clip-rect.html
*
LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-3d-transformed-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-3d-transformed.html:
Added.
* LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-nested-expected.txt:
Added.
* LayoutTests/http/tests/site-isolation/ios/exposed-content-rect-nested.html:
Added.
* LayoutTests/http/tests/site-isolation/ios/exposed-content-rect.html: Added.
*
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-3d-transformed-cross-origin-iframe-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-3d-transformed-cross-origin-iframe.html:
Added.
*
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-cross-origin-iframe-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/request-animation-frame-throttling-scrolled-out-cross-origin-iframe.html:
Added.
*
LayoutTests/http/tests/site-isolation/resources/frame-geometry-child-cross-site.html:
Added.
*
LayoutTests/http/tests/site-isolation/resources/frame-geometry-frame-with-same-site-child.html:
Added.
* LayoutTests/http/tests/site-isolation/resources/frame-geometry-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/resources/frame-geometry-grandchild-same-site.html:
Added.
* LayoutTests/http/tests/site-isolation/resources/frame-geometry-reporter.js:
Added.
* LayoutTests/http/tests/site-isolation/resources/frame-geometry-test.js: Added.
*
LayoutTests/http/tests/site-isolation/resources/request-animation-frame-throttling-frame.html:
*
LayoutTests/http/tests/site-isolation/window-clip-rect-3d-transformed-expected.txt:
Added.
* LayoutTests/http/tests/site-isolation/window-clip-rect-3d-transformed.html:
Added.
* LayoutTests/http/tests/site-isolation/window-clip-rect-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/window-clip-rect-nested-expected.txt:
Added.
* LayoutTests/http/tests/site-isolation/window-clip-rect-nested.html: Added.
* LayoutTests/http/tests/site-isolation/window-clip-rect.html: Added.
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/page/FrameTree.h:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::mapAbsoluteToChildFrameViewRect const):
(WebCore::LocalFrameView::mapAbsoluteToChildFrameViewRect):
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::syncLocalFrameInfoToRemote):
* Source/WebCore/page/RemoteFrameLayoutInfo.cpp:
(WebCore::RemoteFrameLayoutInfo::RemoteFrameLayoutInfo):
(WebCore::operator<<):
(WebCore::RemoteFrameLayoutInfo::mapParentContentsToChildWindow const): Deleted.
* Source/WebCore/page/RemoteFrameLayoutInfo.h:
(WebCore::RemoteFrameLayoutInfo::onScreenRectInChildView const):
(WebCore::RemoteFrameLayoutInfo::exposedContentRectInChildView const):
(WebCore::RemoteFrameLayoutInfo::windowClipRectInParent const): Deleted.
(WebCore::RemoteFrameLayoutInfo::exposedContentRectInParent const): Deleted.
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::windowClipRect):
(WebCore::Internals::exposedContentRect):
(WebCore::Internals::delegatesScrollingToNativeView):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateChildFrameVisibleRectsFromParent):
Canonical link: https://commits.webkit.org/320528@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications