Bug 212245 - DataTransfer.files contains multiple files when pasting a single image with multiple representations
Summary: DataTransfer.files contains multiple files when pasting a single image with m...
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
: 215145 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-21 18:51 PDT by Wenson Hsieh
Modified: 2020-08-04 20:45 PDT (History)
7 users (show)

See Also:


Attachments
Patch (13.15 KB, patch)
2020-05-21 19:15 PDT, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Patch for landing (13.15 KB, patch)
2020-05-21 21:05 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 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. ***