Bug 243374

Summary: dragend event doesn't have dragged content unlike drop event
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ap, bfulgham, karlcow, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
URL: https://jsfiddle.net/3vjnqdmw/show
Attachments:
Description Flags
safari, firefox, chrome console log for event.dataTransfer none

Description Ahmad Saleem 2022-07-30 10:49:51 PDT
Hi Team,

Thanks for your continuous effort.

I took the example data from below mentioned source and changed it into JSFiddle:

JSFiddle Link - https://jsfiddle.net/3vjnqdmw/show

Source - http://udn.realityripple.com/docs/Web/API/DataTransfer/clearData

Now I experience following bug:

*** STEPS TO REPRODUCE ***

1. Open JSFiddle and Run
2. Drag and Drag [Select this element...] into [Drop Zone]

>> ACTUAL RESULT:

Status: Drop done
Data is: empty

>> EXPECTED RESULT:

Status: Drop done
Data is: source

_____

Other browsers:

Chrome Canary 106 -> same as Safari 15.6

Firefox Nightly 105 -> Show "Expected Result".

_______

Thanks for your continuous work, please mark it as duplicate since I am not able to find related bug. Hence, I am filing this.
Comment 1 Ryosuke Niwa 2022-07-31 12:39:24 PDT
This isn't really an issue with clearData but rather with dragend event getting dispatched without the drag content.
Comment 2 Karl Dubost 2022-07-31 20:09:49 PDT
Created attachment 461328 [details]
safari, firefox, chrome console log for event.dataTransfer

Firefox Nightly 105.0a1
Google Chrome Canary 106.0.5212.0
Safari 16.0


According to
https://html.spec.whatwg.org/multipage/dnd.html#dndevents

The drag data store mode is 
drop    -> read-only mode
dragend -> protected mode


Protected mode.
https://html.spec.whatwg.org/multipage/dnd.html#concept-dnd-p

> For all other events. The formats and kinds in the drag data store list of items representing dragged data can be enumerated, but the data itself is unavailable and no new data can be added.


*data itself is unavailable*
So would it be a bug from Firefox?
Comment 3 Karl Dubost 2022-08-01 18:36:24 PDT
I opened https://bugzilla.mozilla.org/show_bug.cgi?id=1782633
Comment 4 Radar WebKit Bug Importer 2022-08-06 10:50:16 PDT
<rdar://problem/98247037>
Comment 5 Ryosuke Niwa 2022-08-06 14:20:25 PDT
I think this is config changed since WebKit's behavior is probably right here.