Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d376be4e979439224f404894a733b8a4000730c4
      
https://github.com/WebKit/WebKit/commit/d376be4e979439224f404894a733b8a4000730c4
  Author: Kiet Ho <[email protected]>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/transformed-iframe-subframe.html
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-cross-origin-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-cross-origin.html
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-same-origin-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-same-origin.html
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-cross-origin-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-cross-origin.html
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-same-origin-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-same-origin.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/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] Project rect from local to absolute 
before intersecting with synced visibleRectOfChild
rdar://178172371
https://bugs.webkit.org/show_bug.cgi?id=315779

Reviewed by Simon Fraser.

In computeClippedRectInRootContentsSpace, there's an alternative codepath
for computing visible rect when the frame owner renderer is not available
(as in the case when Site Isolation is enabled). In the process that contains
the frame owner renderer, we pre-compute the visible rect of the entire
renderer rect in its RenderView and synchronize it as visibleRectOfChild
using RemoteFrameLayoutInfo. In other processes, given a rectangle that's
entirely within the renderer rect, we can simply intersect it with
visibleRectOfChild (retrieved from FrameView::visibleRectOfChild) to get
the visible rect of tha rect.

Except that visibleRectOfChild is in the coordinate space of the enclosing
frame's RenderView, while the input rect to 
computeClippedRectInRootContentsSpace
is in the coordinate space of the frame owner renderer. So we have to project
the input rect to the coordinate space of the RenderView first. This is
usually done by using localToContainerQuad, but remember in Site
Isolation we don't have access to the frame owner renderer.

localToContainerQuad works by accumulating offsets and transforms from
a renderer up to the container into a TransformState, then applying
the transform on the input quad. This patch pre-computes the TransformState
to go from frame owner renderer -> RenderView, then synchronize the
transform matrix using RemoteFrameLayoutInfo. Then other processes
can perform the conversion using the synchronized matrix.

This change should NOT affect non-SI usecases as it only changes the
SI codepath.

Tests: 
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-cross-origin.html
       
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-same-origin.html
       
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-cross-origin.html
       
imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-same-origin.html

* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/resources/transformed-iframe-subframe.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-cross-origin-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-cross-origin.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-same-origin-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-001-same-origin.html:
 Added.
    - Add tests that check that intersection observer works in transformed 
iframes.
      These tests applies perspective transform on the iframes, and will fail 
if the
      synchronized matrix is reduced to affine form (instead of just flattened).
      There's one FAIL caused by existing code, tracked at webkit.org/b/315909

* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-cross-origin-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-cross-origin.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-same-origin-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/intersection-observer/transformed-iframe-002-same-origin.html:
 Added.
    - Add tests similar to transformed-iframe-001-*.html

* LayoutTests/platform/ios-site-isolation/TestExpectations:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
    - Mark cross-origin tests as failed - Intersection Observer x Site Isolation
      doesn't work (yet).

* Source/WebCore/page/FrameView.h:
* Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::computeClippedRectInRootContentsSpace):
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::childFrameOwnerToRootContentTransform 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::childFrameOwnerToRootContentTransform const):
* Source/WebCore/page/RemoteFrameView.cpp:
(WebCore::RemoteFrameView::childFrameOwnerToRootContentTransform const):
* Source/WebCore/page/RemoteFrameView.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/314685@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to