Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b4a7920b91df67da0e06ab3382c84f38b7bea9e8
https://github.com/WebKit/WebKit/commit/b4a7920b91df67da0e06ab3382c84f38b7bea9e8
Author: Wenson Hsieh <[email protected]>
Date: 2025-07-02 (Wed, 02 Jul 2025)
Changed paths:
A
LayoutTests/editing/selection/ios/live-text-selection-in-video-expected.txt
A LayoutTests/editing/selection/ios/live-text-selection-in-video.html
M Source/WebCore/editing/Editing.cpp
M Source/WebCore/editing/Editing.h
M Source/WebCore/page/TextIndicator.cpp
M Source/WebKit/Shared/EditorState.h
M Source/WebKit/Shared/EditorState.serialization.in
M Source/WebKit/UIProcess/ios/WKTextInteractionWrapper.mm
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Log Message:
-----------
[iOS] [SelectionHonorsOverflowScrolling] No selection UI after selecting text
on paused video
https://bugs.webkit.org/show_bug.cgi?id=295380
rdar://154794749
Reviewed by Abrar Rahman Protyasha.
When selecting Live Text in a video, the selection UI is currently obscured by
the `WKVideoView`
above it. This happens because our logic currently prefers keeping selection UI
below child content
layers rather than above, so that composited layers can correctly overlap or
occlude the selection
on iOS. However, in the case of videos, the composited layer representing the
video element is
backed by an `m_contentsLayer` representing the video player layer which is
opaque, thereby covering
the selection. There's currently no mechanism to detect this and ensure that
the selection UI is
inserted above the video layer.
To fix this, we detect the case where the composited `GraphicsLayer` containing
the selection uses a
contents layer (in this case, a video player layer) and err on the side of
inserting the selection
UI above all the other composited children under the layer (which aligns with
shipping behavior on
iOS).
* LayoutTests/editing/selection/ios/live-text-selection-in-video-expected.txt:
Added.
* LayoutTests/editing/selection/ios/live-text-selection-in-video.html: Added.
Add a layout test to exercise the change by injecting Live Text into a video
element and selecting.
* Source/WebCore/editing/Editing.cpp:
(WebCore::computeEnclosingLayer):
Make this return the enclosing `GraphicsLayer` as well, so that we can use it
in the call site.
* Source/WebCore/editing/Editing.h:
* Source/WebCore/page/TextIndicator.cpp:
(WebCore::initializeIndicator):
* Source/WebKit/Shared/EditorState.h:
* Source/WebKit/Shared/EditorState.serialization.in:
* Source/WebKit/UIProcess/ios/WKTextInteractionWrapper.mm:
(-[WKTextInteractionWrapper prepareToMoveSelectionContainer:]):
Adjust this logic to insert all the selection views as the last of the parent
view's subviews, only
if the enclosing graphics layer `usesContentsLayer`; see above for more details.
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computeEnclosingLayerID const):
Set `enclosingLayerUsesContentsLayer` if and only if the enclosing layer
`usesContentsLayer`.
Canonical link: https://commits.webkit.org/296954@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes