Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS 16] 'Insert text from camera' action should not appear in the ed…
…it menu when a range is selected https://bugs.webkit.org/show_bug.cgi?id=243171 Reviewed by Devin Rousso. This is another platform behavior (similar to the one fixed in `252764@main`) that broke due to the new edit menu in iOS 16. The "Insert from camera" action (which shows up as a Live Text button in the edit menu) was intended to only show up when the selection is collapsed and editable; however, WebKit diverges from this platform behavior, since our logic for special-casing the edit menu is based around checking whether the `sender` in `canPerformActionForWebView:withSender:` is a `UIMenuController`, which is not the case when the iOS 16+ edit menu is enabled. To fix this, check the newly introduced `_isPreparingEditMenu` flag instead. Changes tested by augmenting an existing API test: `WebKit.CaptureTextFromCamera` * Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm: Canonical link: https://commits.webkit.org/252805@main
- Loading branch information