Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Cmd-G after Cmd-E fails to highlight found result
https://bugs.webkit.org/show_bug.cgi?id=245266 rdar://97791726 Reviewed by Wenson Hsieh. Cmd-E is the keyboard shortcut for "Use Selection For Find". When followed by Cmd-G, the selection is used to search the text. In this flow of events, the find panel is not intended to be displayed. Instead, the found result should simply be flashed (briefly highlighted) and selected. This functionality is currently unsupported in `WebFoundTextRangeController` as the highlight (text indicator) is drawn in the find overlay layer, and the layer is only displayed when a find panel is visible. To fix, in this scenario, display the text indicator using the UI process. * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setTextIndicator const): * Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp: (WebKit::WebFoundTextRangeController::decorateTextRangeWithStyle): Perform the alternate logic if no find overlay layer exits. This approach matches `UITextView`s logic to differentiate between a full find session (where and overlay and panel are visible), and the Cmd-E / Cmd-G behavior. (WebKit::WebFoundTextRangeController::createTextIndicatorForRange): Factor out text indicator creation into a common method. (WebKit::WebFoundTextRangeController::setTextIndicatorWithRange): (WebKit::WebFoundTextRangeController::flashTextIndicatorAndUpdateSelectionWithRange): Flash (bounce) the text indicator using the UI process via the ChromeClient. Ensure the selection is updated in the web process. * Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setTextIndicator): * Source/WebKit/WebProcess/WebPage/WebPage.h: Canonical link: https://commits.webkit.org/254574@main
- Loading branch information
Showing
5 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters