[webkit-changes] [WebKit/WebKit] 8b79cd: [visionOS] Find overlay is missing behind find bar

Aditya Keerthi noreply at github.com
Tue Aug 29 20:25:31 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8b79cd47f0ad395d40922b70a9068c48a1c73c97
      https://github.com/WebKit/WebKit/commit/8b79cd47f0ad395d40922b70a9068c48a1c73c97
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    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
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in

  Log Message:
  -----------
  [visionOS] Find overlay is missing behind find bar
https://bugs.webkit.org/show_bug.cgi?id=260815
rdar://107376322

Reviewed by Wenson Hsieh.

On visionOS, the find bar appears in the scroll view's inset area. Currently,
WebKit does not display a find overlay in the inset area, as the overlay is
tied to the web content. Specifically, the find overlay is a `PageOverlay` in
the web process, since the overlay must appear behind the highlights (which are
drawn in Web process).

To fix, add another overlay layer to the scroll view, designed to cover the
inset area. The UI process-side overlay is inserted behind the content view, to
avoid a double overlay, while still covering the inset area. Additionally,
the overlay is sized to match the scroll view's bounds, and its position is
adjusted as the scroll view is scrolled, to avoid creating an unnecessarily
large layer. In order to synchronize the animation between the `PageOverlay`
originated layer, and the new UI process-originated layer, existing SPI is
leveraged, and the animation is fully driven from the UI process.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView scrollViewDidScroll:]):
(-[WKWebView _frameOrBoundsMayHaveChanged]):
(-[WKWebView _animationForFindOverlay:]):
(-[WKWebView _updateFindOverlayPosition]):

Update the overlay whenever the scroll position or scroll view size changes.

(-[WKWebView _showFindOverlay]):

Some clients may attempt to show an overlay when one is already visible. Handle
that scenario by cancelling any existing animations.

(-[WKWebView _hideFindOverlay]):

Only remove layers after the animation is complete.

(-[WKWebView _didAddLayerForFindOverlay:]):
(-[WKWebView _didRemoveLayerForFindOverlay]):
(-[WKWebView _removeLayerForFindOverlay]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didEndTextSearchOperation): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView didBeginTextSearchOperation]):
(-[WKContentView didEndTextSearchOperation]):
* Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp:
(WebKit::WebFoundTextRangeController::didEndTextSearchOperation): Deleted.
* Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didEndTextSearchOperation): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

Canonical link: https://commits.webkit.org/267443@main




More information about the webkit-changes mailing list