Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c1f47ba1ffeb05c6be9101452c93b3b4a2dfdece
      
https://github.com/WebKit/WebKit/commit/c1f47ba1ffeb05c6be9101452c93b3b4a2dfdece
  Author: Kiet Ho <[email protected]>
  Date:   2025-12-12 (Fri, 12 Dec 2025)

  Changed paths:
    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/RemoteFrameView.cpp
    M Source/WebCore/page/RemoteFrameView.h

  Log Message:
  -----------
  [intersection-observer] Move layout information needed to compute 
intersections to FrameView
rdar://164746246
https://bugs.webkit.org/show_bug.cgi?id=302548

Reviewed by Simon Fraser.

With Site Isolation, layout information of cross-origin frames are only 
available
in the process that loads up the frame. An intersection observer computing the
intersection in another process wouldn't have access to this info.

This patch makes the minimal set of needed layout information available in
FrameView. The intersection code is then changed to use the info in FrameView.

Getting these info from a LocalFrameView will calculate it on the fly (because
local frames have access to the render tree), while for now, RemoteFrameView
will ASSERT_NOT_REACHED. A future patch will synchronize these information
from Local to RemoteFrameView using FrameTreeSyncData, so these information
are available in RemoteFrameView too.

Tested by the existing Intersection Observer test suites.

* Source/WebCore/page/FrameView.h:
    - Make layoutViewportRect() virtual, so RemoteFrameView could override it
      (when information synching is implemented)
    - Add visibleRectInParentFrame(), the visible portion of the frame's 
viewport in its parent frame.

* Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::computeClippedRectInRootContentsSpace):
    - Accept either the RenderView to the frame (in the case of local frame)
      or Frame object of the frame (in the case of remote frame)
    - In the case of remote frame, compute intersection using 
FrameView::visibleRectOfChild

(WebCore::IntersectionObserver::computeIntersectionState const):
(WebCore::IntersectionObserver::updateObservations):
* Source/WebCore/page/IntersectionObserver.h:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::visibleRectOfChild const):
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/RemoteFrameView.cpp:
(WebCore::RemoteFrameView::layoutViewportRect const):
(WebCore::RemoteFrameView::visibleRectOfChild const):
* Source/WebCore/page/RemoteFrameView.h:

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



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

Reply via email to