This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
Find on page intermittently fails to show results in PDFs in Safari
https://bugs.webkit.org/show_bug.cgi?id=251311 rdar://100155151 Reviewed by Aditya Keerthi. When viewing a PDF in Safari, Find in Page fails after the following sequence of events: 1. Open a PDF in Safari 2. Activate Find in Page and search for a string 3. Refresh the page 4. Activate Find in Page again After the last step, Find In Page will continue to return zero results regardless of the search string. This is because the `WKPDFView` instance is used as the `UIFindSession`'s "searchable object" to process the search. When the page is refreshed, a new `WKPDFView` instance is created, but not a new `UIFindSession`, and so the session has lost its searchable object. This PR fixes this by setting the session's searchable object to the new `WKPDFView` in the `_didCommitLoadForMainFrame` method, which is called after the new `WKPDFView` has been created. This ensures that the session's searchable object is up to date. * Source/WebKit/Platform/spi/ios/UIKitSPI.h: * Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _didCommitLoadForMainFrame]): * Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm: (swizzledPerformTextSearchWithQueryString): (TEST): Canonical link: https://commits.webkit.org/259655@main
- Loading branch information
Showing 3 changed files with 48 additions and 2 deletions.