Bug 212245

Summary: DataTransfer.files contains multiple files when pasting a single image with multiple representations
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, bdakin, jessicap, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
thorton: review+
Patch for landing none

Description Wenson Hsieh 2020-05-21 18:51:20 PDT
<rdar://problem/60240436>
Comment 1 Wenson Hsieh 2020-05-21 19:15:16 PDT
Created attachment 400010 [details]
Patch
Comment 2 Tim Horton 2020-05-21 21:02:43 PDT
Comment on attachment 400010 [details]
Patch

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

> Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm:246
> -    _writtenPasteboardItems = adoptNS([[NSMutableArray<NSPasteboardItem *> alloc] initWithCapacity:objects.count]);
> +    auto items = adoptNS([[NSMutableArray<NSPasteboardItem *> alloc] initWithCapacity:objects.count]);

It looks funny to see the type specialization there! But I guess it is fine.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:58
> +    for (NSDictionary <NSString *, NSData *> *typesAndData in items) {

No space before the < ... I /think/?
Comment 3 Wenson Hsieh 2020-05-21 21:04:38 PDT
Comment on attachment 400010 [details]
Patch

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

>> Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.mm:246
>> +    auto items = adoptNS([[NSMutableArray<NSPasteboardItem *> alloc] initWithCapacity:objects.count]);
> 
> It looks funny to see the type specialization there! But I guess it is fine.

😎

>> Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm:58
>> +    for (NSDictionary <NSString *, NSData *> *typesAndData in items) {
> 
> No space before the < ... I /think/?

Ah, that’s right — it’s only a space before the < if it’s for a @protocol, IIRC.
Comment 4 Wenson Hsieh 2020-05-21 21:05:47 PDT
Created attachment 400023 [details]
Patch for landing
Comment 5 EWS 2020-05-21 21:42:52 PDT
Committed r262047: <https://trac.webkit.org/changeset/262047>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400023 [details].
Comment 6 Wenson Hsieh 2020-08-04 20:45:26 PDT
*** Bug 215145 has been marked as a duplicate of this bug. ***