Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 09104a6e1e5dd370ef0b0a85eae08b6d0e7920c4
https://github.com/WebKit/WebKit/commit/09104a6e1e5dd370ef0b0a85eae08b6d0e7920c4
Author: Jessica Lee <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M Source/WebKit/UIProcess/FindStringCallbackAggregator.cpp
M Source/WebKit/UIProcess/FindStringCallbackAggregator.h
M Source/WebKit/WebProcess/WebPage/FindController.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
Log Message:
-----------
[Site Isolation] matchIndex should track position across remote frames, not
just per-frame.
https://bugs.webkit.org/show_bug.cgi?id=324599
rdar://187833234
Reviewed by Brady Eidson.
Currently, WebKit only aggregates matchCount across processes but does not
track the matchCount per frame.
This causes FindStringCallbackAggregator to report the matchIndex relative to
the frame and not globally.
The fix is to track the match count per frame. We offset the current frame's
index by the sum of the previous
frames' match counts.
Separately, in FindController.cpp, we also include a fix so that the matchIndex
for the selected frame is not
double-counted. FindStringCallbackAggregator's destructor sends
SelectLastFoundRange to the target frame so it
can apply its match as a visible selection and report back its rects and index.
This invokes an additional
FindController::findString call on that same frame, which re-counts a
matchIndex that was already computed by
that frame's initial findString call.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
* Source/WebKit/UIProcess/FindStringCallbackAggregator.cpp:
(WebKit::FindStringCallbackAggregator::foundString):
(WebKit::FindStringCallbackAggregator::globalIndexOffsetForFrame):
(WebKit::FindStringCallbackAggregator::~FindStringCallbackAggregator):
* Source/WebKit/UIProcess/FindStringCallbackAggregator.h:
* Source/WebKit/WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::findString):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation, FindStringMatchIndexAcrossFrames)):
Canonical link: https://commits.webkit.org/321553@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications