Bug 241333 - Drag and drop from Word to Safari contentEditable doesn't work
Summary: Drag and drop from Word to Safari contentEditable doesn't work
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 15
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-06-06 04:42 PDT by hamza.benkhaldoun
Modified: 2022-06-06 16:30 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hamza.benkhaldoun 2022-06-06 04:42:17 PDT
Hi,

Selecting a chunk of text from a word document opened in Microsoft word, dragging the selection, then dropping it in a contentEditable div results in nothing being actually dropped.
Here is a codesandbox reproduction sample: https://codepen.io/hamza0867/pen/ZErRJbp?editors=1111 

Thank you
Comment 1 Alexey Proskuryakov 2022-06-06 09:20:21 PDT
I can reproduce this with latest Word (16.60). Works with TextEdit.

Guessing that Word may be providing a promise instead of full data in the drag pasteboard, I don't remember any code in WebKit to support that.
Comment 2 Radar WebKit Bug Importer 2022-06-06 09:20:33 PDT
<rdar://problem/94440920>
Comment 3 Wenson Hsieh 2022-06-06 09:23:46 PDT
(In reply to Alexey Proskuryakov from comment #1)
> I can reproduce this with latest Word (16.60). Works with TextEdit.
> 
> Guessing that Word may be providing a promise instead of full data in the
> drag pasteboard, I don't remember any code in WebKit to support that.

There is a promise reading codepath in WebKit, but it only works in the context of promised file URLs (by calling into `-receivePromisedFilesAtDestination:options:operationQueue:reader:`). It seems like we'll need to generalize this to work with rich text data.