Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b2c0cb3643d55a246e7067924b9c8450f54c74ad
https://github.com/WebKit/WebKit/commit/b2c0cb3643d55a246e7067924b9c8450f54c74ad
Author: Cole Carley <[email protected]>
Date: 2026-10-12 (Mon, 12 Oct 2026)
Changed paths:
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/Page.h
M Source/WebKit/Scripts/webkit/messages.py
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebPageProxy.messages.in
M Source/WebKit/WebProcess/WebPage/FindController.cpp
M Source/WebKit/WebProcess/WebPage/FindController.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindCAPI.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindTextFinder.mm
Log Message:
-----------
findStringMatches is only sent to the main frame's process.
https://bugs.webkit.org/show_bug.cgi?id=326399
rdar://189232713
Reviewed by Ryosuke Niwa.
With site isolation, WebPageProxy::findStringMatches and the associated follow
up
calls (selectFindMatch, indicateFindMatch, getImageForFindMatch, replaceMatches)
were only sent to the main frame's process, so matches in cross-origin iframes
were never found or acted on.
findStringMatches now goes to every web content process. Each process returns
its matches grouped by frame, along with the frame that has the selection and
the selection's position among that frame's matches. The UI process puts the
results in frame-tree order and caps them at maxMatchCount. It also keeps a
table that maps each global match index to (frame, index within that process),
so the follow-up calls go to the process that owns the match. The process
holding the first selection in frame-tree order computes
firstIndexAfterSelection.
When find UI is requested and the page has remote frames, each process searches
without drawing find UI. The UI process then sends
UpdateFindUIAfterFindingAllMatches
to every process once all results are in, and only the process with the
selection
updates the find indicator. That way two processes never both show an indicator.
Tests: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindCAPI.mm
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindTextFinder.mm
* Source/WebCore/page/Page.cpp:
(WebCore::Page::findTextMatches):
* Source/WebCore/page/Page.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::findStringMatches):
(WebKit::WebPageProxy::findMatchLocation const):
(WebKit::WebPageProxy::getImageForFindMatch):
(WebKit::WebPageProxy::selectFindMatch):
(WebKit::WebPageProxy::indicateFindMatch):
(WebKit::WebPageProxy::replaceMatches):
(WebKit::WebPageProxy::didGetImageForFindMatch): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterFindingAllMatches):
(WebKit::FindController::findStringMatches):
(WebKit::FindController::scheduleFindUIUpdateAfterFindingAllMatches):
(WebKit::FindController::getImageForFindMatch):
* Source/WebKit/WebProcess/WebPage/FindController.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::findStringMatches):
(WebKit::WebPage::getImageForFindMatch):
(WebKit::WebPage::updateFindUIAfterFindingAllMatches):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindCAPI.mm:
(TestWebKitAPI::TEST_P):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/FindTextFinder.mm:
(TestWebKitAPI::TEST_P):
Canonical link: https://commits.webkit.org/323501@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications