Bug 194921 - insertFromPaste InputEvent missing pasted files in dataTransfer
Summary: insertFromPaste InputEvent missing pasted files in dataTransfer
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 12
Hardware: Mac macOS 10.14
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-21 14:18 PST by Javan Makhmali
Modified: 2022-05-31 14:59 PDT (History)
6 users (show)

See Also:


Attachments
File paste. Left: Safari, Right: Chrome (74.10 KB, image/png)
2019-02-21 14:18 PST, Javan Makhmali
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Javan Makhmali 2019-02-21 14:18:54 PST
Created attachment 362646 [details]
File paste. Left: Safari, Right: Chrome

To reproduce: 
1. Copy an image to the clipboard and paste it into a contenteditable element.
2. Inspect the "paste" event and note that it contains the pasted file in its clipboardData.
3. Inspect the "beforeinput" or "input" event and note that its dataTransfer has no files. (The dataTransfer does have text/html with a mostly unusable <img src="blob:…"> element, which may be a separate issue)

Examples:
- Visit https://input-inspector.now.sh/profiles/QVByHqieNlP2I6j0THUr to see example paste data using Safari 12.0.3.
- For comparison, visit https://input-inspector.now.sh/profiles/puEtJKhSeFz3IVNweSf2 to see the same paste in Chrome 72.
- Or, view the attached screenshot of both.
Comment 1 Radar WebKit Bug Importer 2019-02-21 15:20:55 PST
<rdar://problem/48292715>
Comment 2 Ahmad Saleem 2022-05-31 14:59:28 PDT
I am able to reproduce this issue in Safari 15.5 on macOS 12.4 but Chrome Canary 104 does not matches with the attached screenshots in behaviour. In Chrome Canary 104, after pasting - Input remains empty and only "beforeinput" has screenshots details. Firefox Nightly 103 shows data about pasted picture in both "input" and "beforeinput" fields. Thanks!