Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dc0ab49b51f17b5b0995ee1a0207e440907a36ac
https://github.com/WebKit/WebKit/commit/dc0ab49b51f17b5b0995ee1a0207e440907a36ac
Author: Kiet Ho <[email protected]>
Date: 2026-06-15 (Mon, 15 Jun 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-cross-origin-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-cross-origin.html
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-same-origin-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-same-origin.html
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-cross-origin-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-cross-origin.html
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-same-origin-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-same-origin.html
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-non-invertible-iframe-cross-origin-crash.sub.html
A
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-non-invertible-iframe-same-origin-crash.html
M LayoutTests/platform/ios-site-isolation/TestExpectations
M LayoutTests/platform/mac-site-isolation/TestExpectations
M Source/WebCore/page/FrameView.h
M Source/WebCore/page/IntersectionObserver.cpp
M Source/WebCore/page/IntersectionObserver.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/page/RemoteFrameView.cpp
M Source/WebCore/page/RemoteFrameView.h
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
Log Message:
-----------
[Site Isolation] [intersection-observer] Compute rootViewToContents in Site
Isolation mode
rdar://167805455
https://bugs.webkit.org/show_bug.cgi?id=305160
Reviewed by Simon Fraser.
In implicit root mode, IntersectionObserver first computes the visible rect in
the
root view (main frame) first, then use rootViewToContents to convert it back
to the visible rect in the target's frame view.
FrameView::rootViewToContents does this by traversing from the main frame to the
target frame in the frame tree. It converts the rect from absolute (current
frame)
to local (next frame's owner element), then repeats this until it reaches the
target
frame's owner element. If Site Isolation is enabled, and any frames are
cross-origin
from the target frame, then we don't have the layout information for the
absolute ->
local conversion.
This patch makes rootViewToContents work in Site Isolation by synchronizing the
absolute -> local transformation matrix using RemoteFrameLayoutInfo. This way,
the absolute -> local conversion can be done anywhere by multiplying the
absolute
rect with the synchronized transformation matrix.
Instead of changing FrameView::rootViewToContents to make it SI-safe,
IntersectionObserver
will use a function that is equivalent to rootViewToContents but with Site
Isolation
support. This ensures we don't accidentally break existing use cases of
rootViewToContents.
Once we know this works, we could port back the changes to rootViewToContents.
Tests:
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-cross-origin.html
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-same-origin.html
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-cross-origin.html
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-same-origin.html
imported/w3c/web-platform-tests/intersection-observer/transformed-non-invertible-iframe-cross-origin-crash.sub.html
imported/w3c/web-platform-tests/intersection-observer/transformed-non-invertible-iframe-same-origin-crash.html
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-cross-origin-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-cross-origin.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-same-origin-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-003-same-origin.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-cross-origin-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-cross-origin.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-same-origin-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-004-same-origin.html:
Added.
- Add tests that require the synchronized transformation matrix to be
original and not flattened/affined before synchronization.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-non-invertible-iframe-cross-origin-crash.sub.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-non-invertible-iframe-same-origin-crash.html:
Added.
* LayoutTests/platform/ios-site-isolation/TestExpectations:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
- Pass more tests.
* Source/WebCore/page/FrameView.h:
* Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::convertFromContainingView):
(WebCore::convertFromRootView):
(WebCore::mainFrameViewToContents):
(WebCore::IntersectionObserver::computeIntersectionState const):
* Source/WebCore/page/IntersectionObserver.h:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::absoluteToChildFrameOwnerLocalTransform const):
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::syncLocalFrameInfoToRemote):
* Source/WebCore/page/RemoteFrameLayoutInfo.cpp:
(WebCore::RemoteFrameLayoutInfo::create):
(WebCore::RemoteFrameLayoutInfo::RemoteFrameLayoutInfo):
* Source/WebCore/page/RemoteFrameLayoutInfo.h:
(WebCore::RemoteFrameLayoutInfo::absoluteToChildFrameOwnerLocalTransform const):
* Source/WebCore/page/RemoteFrameView.cpp:
(WebCore::RemoteFrameView::absoluteToChildFrameOwnerLocalTransform const):
* Source/WebCore/page/RemoteFrameView.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
Canonical link: https://commits.webkit.org/315227@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications