Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8b41c4e1111a3394a97dd2ba6f079c2ece2c7dcd
https://github.com/WebKit/WebKit/commit/8b41c4e1111a3394a97dd2ba6f079c2ece2c7dcd
Author: Sihui Liu <[email protected]>
Date: 2026-08-31 (Mon, 31 Aug 2026)
Changed paths:
M Source/WebKit/Shared/WebFindOptions.h
M Source/WebKit/UIProcess/FindStringCallbackAggregator.cpp
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
Log Message:
-----------
[Site Isolation] Find in page reports the number of Web processes that found
the string as the match count
rdar://186124519
Reviewed by Per Arne Vollan.
FindController only counts matches when the find was requested with
ShowOverlay, ShowHighlight or DetermineMatchIndex,
because those options have to visit every match anyway. Otherwise the find is
incremental - it stops at the first match
after the current selection - and updateFindUIAfterIncrementalFind reports 1 to
mean "found something".
Under Site Isolation isolation, WebPageProxy::findString fans the find out to
every process and
FindStringCallbackAggregator sums the replies, so without a counting option it
sums those placeholders and reports the
number of processes that found the string. On a page with a matching main frame
and two matching cross-site iframes the
reported count was 3 with full isolation and 2 with shared process mode, where
both iframes are in one process and its
single reply covers both matches. The same page reports 1 without Site
Isolation. This is not reachable through public
API: WKFindResult only exposes matchFound.
Sum the per-process counts only when a counting option was requested, so the
value no longer depends on how the page's
frames are distributed across processes. Nothing changes for clients that do
ask for a count, since each process counts
the matches in its own local frames and every frame belongs to exactly one
process. SiteIsolation.FindStringMatchCount
asserted 3, which only held because the three matching documents happened to be
in three processes; it now pins
SiteIsolationSharedProcessEnabled off and
SiteIsolation.FindStringMatchCountWithSharedProcess pins it on, so both
process models are covered whatever the default becomes, and both assert the
same numbers.
* Source/WebKit/Shared/WebFindOptions.h:
(WebKit::willFindAllMatches):
* Source/WebKit/UIProcess/FindStringCallbackAggregator.cpp:
(WebKit::FindStringCallbackAggregator::~FindStringCallbackAggregator):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::checkFindStringMatchCount):
(TestWebKitAPI::findStringMatchCountServer):
(TestWebKitAPI::TEST(SiteIsolation, FindStringMatchCount)):
(TestWebKitAPI::TEST(SiteIsolation, FindStringMatchCountWithSharedProcess)):
Canonical link: https://commits.webkit.org/320196@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications