Skip to content

Commit

Permalink
REGRESSION(274325@main): didFindString is always false when searching…
Browse files Browse the repository at this point in the history
… in PDFs

rdar://122901465
https://bugs.webkit.org/show_bug.cgi?id=269310

Reviewed by Sammy Gill.

After 274325@main, API::FindClient::didFindString() is called in the completion handler of the final
FindString message if a match was found inside a frame. For PDFs, this frame ID was never set, so
didFindString would never be called. For now, if a match is found in a PDF, mark the main frame as the
frame containing the match.

* Source/WebKit/WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::findString):

Canonical link: https://commits.webkit.org/274585@main
  • Loading branch information
charliewolfe committed Feb 13, 2024
1 parent fb0f468 commit 2db6785
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/WebKit/WebProcess/WebPage/FindController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,11 @@ void FindController::findString(const String& string, OptionSet<FindOptions> opt
std::optional<FrameIdentifier> idOfFrameContainingString;
DidWrap didWrap = DidWrap::No;
#if ENABLE(PDF_PLUGIN)
if (pluginView)
if (pluginView) {
found = pluginView->findString(string, coreOptions, maxMatchCount);
else
if (auto* frame = pluginView->frame(); frame && found)
idOfFrameContainingString = frame->frameID();
} else
#endif
{
idOfFrameContainingString = m_webPage->corePage()->findString(string, coreOptions, &didWrap);
Expand Down

0 comments on commit 2db6785

Please sign in to comment.