[webkit-changes] [WebKit/WebKit] 06d20b: [iOS] Cmd-G after Cmd-E fails to highlight found r...

Aditya Keerthi noreply at github.com
Fri Sep 16 16:27:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 06d20b1720047468156477322c5e301a2d2fe204
      https://github.com/WebKit/WebKit/commit/06d20b1720047468156477322c5e301a2d2fe204
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2022-09-16 (Fri, 16 Sep 2022)

  Changed paths:
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp
    M Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h

  Log Message:
  -----------
  [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




More information about the webkit-changes mailing list