-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using -[UITextInteractionAssistant inGesture] and -[UITextIntera…
…ction inGesture] https://bugs.webkit.org/show_bug.cgi?id=262833 Reviewed by Megan Gardner and Abrar Rahman Protyasha. Remove uses of `-[UITextInteractionAssistant inGesture]` and `-[UITextInteraction inGesture]`. We currently use these methods to deduce whether `-updateSelectionWithExtentPoint:completionHandler:` is being triggered by the floating cursor (i.e., when long pressing on the space bar in the software keyboard while holding the shift key). From testing on iOS 17, the other ways to exercise this codepath (outside of holding shift while using floating cursor) are: • Shift-tapping to extend a selection. • Shift-clicking with a trackpad to extend a selection. We can distinguish these two cases from the floating cursor case by consulting gesture recognizer state instead; that is, if any of the following gestures are in Began, Ended or Changed state while updating the selection with an extent point: • Text interaction variable delay loupe gesture. • Text interaction multi-tap gesture. • Mouse click gesture (`WKMouseTouchGestureRecognizer`). ...then we can assume that the selection is being changed by one of the above interactions; otherwise, it's probably due to using the floating cursor. * Source/WebKit/Platform/spi/ios/UIKitSPI.h: * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]): (-[UITextInteractionAssistant _wk_hasFloatingCursor]): Deleted. * Tools/TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm: (TestWebKitAPI::TEST): Adjust a test to simulate mouse clicks before calling `-updateSelectionWithExtentPoint:`. Canonical link: https://commits.webkit.org/269044@main
- Loading branch information
Showing
3 changed files
with
38 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters