Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 00c0c0cb3070ee7f7d9ed660cd93806d5474ca61
      
https://github.com/WebKit/WebKit/commit/00c0c0cb3070ee7f7d9ed660cd93806d5474ca61
  Author: Kiet Ho <[email protected]>
  Date:   2026-05-28 (Thu, 28 May 2026)

  Changed paths:
    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.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] Sync content box location of child 
frame owners
rdar://177986757
https://bugs.webkit.org/show_bug.cgi?id=315607

Reviewed by Simon Fraser.

computeClippedRectInRootContentsSpace (in
IntersectionObserver.cpp) has this code
to account for the border/padding of the owner element:

    if (RefPtr ownerRenderer = enclosingFrame->ownerRenderer()) {
        absoluteClippedRect->moveBy(ownerRenderer->contentBoxLocation());
        return computeClippedRectInRootContentsSpace(*absoluteClippedRect, 
targetSecurityOrigin, ownerRenderer.get(), scrollMargin);
    }

Since the owner renderer might not be available when Site Isolation is
enabled, 304640@main translates it to the following:

    absoluteClippedRect->moveBy(enclosingFrameView->location());
    return computeClippedRectInRootContentsSpace(*absoluteClippedRect, 
targetSecurityOrigin, enclosingFrame.get(), WTF::move(scrollMargin));

This is based on the incorrect assumption that
ownerRenderer->contentBoxLocation() == enclosingFrameView->location(),
but they're not. This patch synchronizes contentBoxLocation() of frame
owner renderers using RemoteFrameLayoutInfo, so they can be used in any
processes
when Site Isolation is enabled.

No tests - tested by existing Intersection Observer tests.

* Source/WebCore/page/FrameView.h:
* Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::computeClippedRectInRootContentsSpace):
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::childFrameOwnerContentBoxLocation const):
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::syncLocalFrameInfoToRemote):
* Source/WebCore/page/RemoteFrameLayoutInfo.h:
* Source/WebCore/page/RemoteFrameView.cpp:
(WebCore::RemoteFrameView::childFrameOwnerContentBoxLocation const):
* Source/WebCore/page/RemoteFrameView.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: 
https://flagged.apple.com:443/proxy?t2=Dr3m4y5DW3&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE0MDY1QG1haW4=&emid=9c24d165-cd18-400c-a68b-6f3eb9d231f9&c=11



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

Reply via email to