Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: edaa1b5300436949ba004b154142bce3c0ce6bcd
https://github.com/WebKit/WebKit/commit/edaa1b5300436949ba004b154142bce3c0ce6bcd
Author: Kiet Ho <[email protected]>
Date: 2025-11-14 (Fri, 14 Nov 2025)
Changed paths:
M Source/WebCore/dom/Document.cpp
M Source/WebCore/page/IntersectionObserver.cpp
M Source/WebCore/page/IntersectionObserver.h
Log Message:
-----------
[intersection-observer] small refactoring to prepare for site isolation
rdar://164675699
https://bugs.webkit.org/show_bug.cgi?id=302500
Reviewed by Simon Fraser.
In the case of implicit root intersection observers, where the root and
target are in different frames, site isolation means layout information
of the root and target (and any frames in between) are in different processes.
Current intersection observer code assumes the layout information of all
frames in the document are available in process. This patch slightly refactors
the logic to avoid accessing potentially out-of-process info when able.
Tested by existing intersection observer test suites.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
- Change method to take a host Frame instead of host Document.
With site isolation, it's not always possible to get the Document
of the main frame.
* Source/WebCore/page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::computeIntersectionState const):
- Avoid some computations that rely on rootRenderer, which could
be out-of-process.
(WebCore::IntersectionObserver::updateObservations):
- Check for same-origin using the frame's security origin from
Frame::frameDocumentSecurityOrigin(). This is always available
for local/remote frames.
* Source/WebCore/page/IntersectionObserver.h:
Canonical link: https://commits.webkit.org/303055@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications