Bug 188957 - [Attachment Support] [WK2] Images copied from Mail message view paste with the wrong file name in compose
Summary: [Attachment Support] [WK2] Images copied from Mail message view paste with th...
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: 2018-08-26 16:57 PDT by Wenson Hsieh
Modified: 2018-10-01 13:56 PDT (History)
8 users (show)

See Also:


Attachments
Depends on webkit.org/b/188903 (6.64 KB, patch)
2018-08-26 17:13 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Rebase on trunk (6.64 KB, patch)
2018-08-26 19:57 PDT, Wenson Hsieh
darin: review+
Details | Formatted Diff | Diff
Patch for landing (6.65 KB, patch)
2018-08-27 09:07 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 2018-08-26 16:57:00 PDT
The resulting file names of the _WKAttachments end up looking something like "6E69C86F-D0D3-4451-830F-E2C96FD063E0@scv.apple.com".
Comment 1 Radar WebKit Bug Importer 2018-08-26 17:03:35 PDT
<rdar://problem/43737715>
Comment 2 Wenson Hsieh 2018-08-26 17:13:17 PDT
Created attachment 348105 [details]
Depends on webkit.org/b/188903
Comment 3 Wenson Hsieh 2018-08-26 19:57:42 PDT
Created attachment 348113 [details]
Rebase on trunk
Comment 4 Darin Adler 2018-08-27 08:36:26 PDT
Comment on attachment 348113 [details]
Rebase on trunk

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:1334
> +    auto mainResource = adoptNS([[WebResource alloc] initWithData:markupData URL:[NSURL URLWithString:@"foo.html"] MIMEType:@"text/html" textEncodingName:@"utf-8" frameName:nil]);
> +    auto pngResource = adoptNS([[WebResource alloc] initWithData:testImageData() URL:[NSURL URLWithString:@"1.png"] MIMEType:@"image/png" textEncodingName:nil frameName:nil]);
> +    auto gifResource = adoptNS([[WebResource alloc] initWithData:testGIFData() URL:[NSURL URLWithString:@"2.gif"] MIMEType:@"image/gif" textEncodingName:nil frameName:nil]);
> +    auto archive = adoptNS([[WebArchive alloc] initWithMainResource:mainResource.get() subresources:@[ pngResource.get(), gifResource.get() ] subframeArchives:@[ ]]);

We should start using ARC for our unit tests.
Comment 5 Wenson Hsieh 2018-08-27 08:50:55 PDT
Comment on attachment 348113 [details]
Rebase on trunk

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

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:1334
>> +    auto archive = adoptNS([[WebArchive alloc] initWithMainResource:mainResource.get() subresources:@[ pngResource.get(), gifResource.get() ] subframeArchives:@[ ]]);
> 
> We should start using ARC for our unit tests.

Noted!

I suppose a good first step towards this is to add bridging casts as needed (in fact, there are several places in this file that directly cast NSStrings to CFStringRefs and vice versa). I'll be fixing these as I go, in subsequent patches.
Comment 6 Wenson Hsieh 2018-08-27 09:07:20 PDT
Created attachment 348148 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2018-08-27 09:45:31 PDT
Comment on attachment 348148 [details]
Patch for landing

Clearing flags on attachment: 348148

Committed r235375: <https://trac.webkit.org/changeset/235375>