Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2b69d15d9a2285fa249f2b55b4f3bf1e60122797
      
https://github.com/WebKit/WebKit/commit/2b69d15d9a2285fa249f2b55b4f3bf1e60122797
  Author: Kiet Ho <[email protected]>
  Date:   2025-12-17 (Wed, 17 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:
  -----------
  [Re-land] [intersection-observer] Move layout information needed to compute 
intersections to FrameView
rdar://166644525
https://bugs.webkit.org/show_bug.cgi?id=304274

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 them on the fly (because
local frames have access to the render tree), while for now, RemoteFrameView 
will
ASSERT_NOT_REACHED. A future patch will make these info available in 
RemoteFrameView
by synchronizing them from Local to RemoteFrameView using FrameTreeSyncData.

Tested by the existing Intersection Observer test suites. This was previously
landed in 304349@main, then got reverted in 304375@main because of a missing
null check causing crashes.

* Source/WebCore/page/FrameView.h:
    - Make layoutViewportRect() virtual, so RemoteFrameView could override it
      (when information sync is implemented)

* 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/304640@main



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

Reply via email to