Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS 16] 'Insert text from camera' action should not appear in the edit menu when a range is selected #2708

Merged
merged 1 commit into from
Jul 25, 2022

Commits on Jul 25, 2022

  1. [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
    whsieh committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    c106e6e View commit details
    Browse the repository at this point in the history