Bug 226387 - [iOS] Adjust logic when determining whether to enable image extraction actions in the callout bar
Summary: [iOS] Adjust logic when determining whether to enable image extraction action...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-28 11:48 PDT by Wenson Hsieh
Modified: 2021-05-28 13:02 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.94 KB, patch)
2021-05-28 11:52 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch for landing (1.91 KB, patch)
2021-05-28 12:06 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2021-05-28 11:48:37 PDT
rdar://76781788
Comment 1 Wenson Hsieh 2021-05-28 11:52:36 PDT
Created attachment 430036 [details]
Patch
Comment 2 Devin Rousso 2021-05-28 11:55:48 PDT
Comment on attachment 430036 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430036&action=review

r=me

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:3790
> +    if (WebKit::isImageExtractionAction(action))
> +        return editorState.isContentEditable && [super canPerformAction:action withSender:sender];

r=me

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:3790
> +        return editorState.isContentEditable && [super canPerformAction:action withSender:sender];

NIT: Seeing as how the next line is also `[super canPerformAction:action withSender:sender]` maybe we can adjust the `if` to avoid repeating it?
```
    if (WebKit::isImageExtractionAction(action) && !editorState.isContentEditable)
        return NO;
```
Comment 3 Wenson Hsieh 2021-05-28 11:58:08 PDT
Comment on attachment 430036 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430036&action=review

>>> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:3790
>>> +        return editorState.isContentEditable && [super canPerformAction:action withSender:sender];
>> 
>> r=me
> 
> NIT: Seeing as how the next line is also `[super canPerformAction:action withSender:sender]` maybe we can adjust the `if` to avoid repeating it?
> ```
>     if (WebKit::isImageExtractionAction(action) && !editorState.isContentEditable)
>         return NO;
> ```

👍🏻
Comment 4 Wenson Hsieh 2021-05-28 12:06:53 PDT
Created attachment 430039 [details]
Patch for landing
Comment 5 EWS 2021-05-28 13:02:36 PDT
Committed r278221 (238259@main): <https://commits.webkit.org/238259@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430039 [details].