Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UIAsyncTextInput] Edit menu doesn't appear after choosing "Select" i…
…n editable content https://bugs.webkit.org/show_bug.cgi?id=265265 rdar://118726761 Reviewed by Aditya Keerthi. Previously, `UIWKTextInteractionAssistant` would automatically present the edit menu after a 200 ms delay, when invoking `-selectAll:` or `-selectWord`. These SPIs are no longer exposed on `UIAsyncTextInteraction`, but we instead have the ability to directly request edit menu presentation via `-presentEditMenuForSelection`. This causes the layout test `editing/selection/ios/show-callout-bar-after-selecting-word.html` to fail when using the async text input/interaction codepath. To fix this, we add logic to schedule edit menu presentation 200 ms after the next selection change, after triggering `-selectWord` or `-selectAll:`. * LayoutTests/editing/selection/ios/show-callout-bar-after-selecting-word-expected.txt: * LayoutTests/editing/selection/ios/show-callout-bar-after-selecting-word.html: Also adjust this test to be more robust, by waiting for the edit menu to no longer contain "Select All". This is because it's possible for the last step of the test: ``` await UIHelper.rectForMenuAction("Select All"); ``` ...to check the contents of the edit menu, before the internal collection view for the edit menu has been reloaded since being shown for the caret selection. This currently causes the test to be flaky, with or without `--use-async-uikit-interactions`, on some versions of iOS 17. * Source/WebKit/UIProcess/ios/WKTextInteractionWrapper.mm: (-[WKTextInteractionWrapper dealloc]): (-[WKTextInteractionWrapper deactivateSelection]): (-[WKTextInteractionWrapper selectionChanged]): Schedule a timer to present the edit menu after 200 ms, after the next selection change after calling `-selectWord` or `-selectAll:`. See above for more details. (-[WKTextInteractionWrapper selectWord]): (-[WKTextInteractionWrapper selectAll:]): (-[WKTextInteractionWrapper showEditMenuTimerFired]): (-[WKTextInteractionWrapper stopShowEditMenuTimer]): Canonical link: https://commits.webkit.org/271114@main
- Loading branch information