Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: db75ea4ed5c1a67c155c3aa859f250af348d7af2
https://github.com/WebKit/WebKit/commit/db75ea4ed5c1a67c155c3aa859f250af348d7af2
Author: Wenson Hsieh <[email protected]>
Date: 2025-11-10 (Mon, 10 Nov 2025)
Changed paths:
A
LayoutTests/editing/selection/ios/show-edit-menu-in-text-field-with-animation-expected.txt
A
LayoutTests/editing/selection/ios/show-edit-menu-in-text-field-with-animation.html
M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Log Message:
-----------
REGRESSION (iOS 26): Edit menu isn’t shown when tapping inside a text field
with looping animation
https://bugs.webkit.org/show_bug.cgi?id=302153
rdar://164290305
Reviewed by Abrar Rahman Protyasha.
When `SelectionHonorsOverflowScrolling` (composited selection UI on iOS) is
enabled, it's possible
to end up in a scenario where the edit menu timer (triggered when tapping
inside an already-focused
editable element) is indefinitely debounced — one easy way to trigger this is
to (1) ensure that the
selection caret is composited in a layer that's not the root layer, and (2) add
an infinitely
looping `content` animation to that enclosing compositing layer, whose duration
is shorter than the
debounce delay of the edit menu timer + edit menu appearance animation (i.e.
about 1 second).
In this case, the layer containing the animation changes with every loop; this,
in turn, causes the
selection drawing info (which now includes a composited layer ID) to change
every loop, which then
makes us call into `-selectionChanged` in `-_updateChangedSelection:`. While
it's necessary to move
the selection container in this case to the new compositing view, it's _not_
necessary to debounce
or reset the edit menu timer.
To fix this, we make the `selectionDrawingInfo != _lastSelectionDrawingInfo`
check a bit more
nuanced, such that it returns a 3-state enum instead describing the comparison
result; this allows
us to only call `-selectionChanged` in the case where the selection actually,
visually changed
(ignoring which compositing view it's hosted in).
Test: editing/selection/ios/show-edit-menu-in-text-field-with-animation.html
*
LayoutTests/editing/selection/ios/show-edit-menu-in-text-field-with-animation-expected.txt:
Added.
*
LayoutTests/editing/selection/ios/show-edit-menu-in-text-field-with-animation.html:
Added.
Add a layout test to verify that the edit menu appears after (1) tapping to
focus a text field with
an infinitely looping animation, and (2) tapping again inside that focused text
field.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(WebKit::WKSelectionDrawingInfo::compare const):
Make this return a tri-state enum, representing the comparison result (visually
distinct, visually
equivalent except for the containing compositing layer, and visually equivalent
including the
containing layer).
(-[WKContentView _updateChangedSelection:]):
(WebKit::operator==): Deleted.
Canonical link: https://commits.webkit.org/302794@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications