Bug 237810 - [Mail compose] Allow copied resources with remote (HTTP/HTTPS) URLs to be pasted as attachments
Summary: [Mail compose] Allow copied resources with remote (HTTP/HTTPS) URLs to be pas...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-12 14:05 PST by Wenson Hsieh
Modified: 2022-03-14 18:56 PDT (History)
9 users (show)

See Also:


Attachments
Patch (7.81 KB, patch)
2022-03-12 14:36 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
For landing (7.83 KB, patch)
2022-03-14 14:34 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 2022-03-12 14:05:26 PST
rdar://90119983
Comment 1 Wenson Hsieh 2022-03-12 14:36:43 PST
Created attachment 454541 [details]
Patch
Comment 2 Devin Rousso 2022-03-14 14:15:52 PDT
Comment on attachment 454541 [details]
Patch

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

r=me, neato :)

> Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:209
> +    return replacementType == ReplacementMethod::Attachment || !url.protocolIsInHTTPFamily();

NIT: I feel like this would read better as a separate if.
```
if (url.protocolIsInHTTPFamily())
    return replacementType == ReplacementMethod::Attachment;

return true;
```
Comment 3 Wenson Hsieh 2022-03-14 14:17:41 PDT
Comment on attachment 454541 [details]
Patch

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

Thanks for the review!

>> Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:209
>> +    return replacementType == ReplacementMethod::Attachment || !url.protocolIsInHTTPFamily();
> 
> NIT: I feel like this would read better as a separate if.
> ```
> if (url.protocolIsInHTTPFamily())
>     return replacementType == ReplacementMethod::Attachment;
> 
> return true;
> ```

Sounds good — will change it to that.
Comment 4 Wenson Hsieh 2022-03-14 14:34:32 PDT
Created attachment 454622 [details]
For landing
Comment 5 EWS 2022-03-14 18:56:23 PDT
Committed r291261 (248413@main): <https://commits.webkit.org/248413@main>

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