Child elements cause dragenter & dragleave order to be reversed

RESOLVED DUPLICATE of bug 619703

Status

()

Core
Drag and Drop
RESOLVED DUPLICATE of bug 619703
7 years ago
2 years ago

People

(Reporter: Aleks Totic, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 509930 [details]
Simple page to demonstrate the bug

If you have following code:
<div>
<p>drop file here</p>
</div>

and you drag a file without droping in this sequence 
desktop -> div -> paragraph -> div -> desktop

dragenter[object HTMLDivElement]
dragenter[object HTMLParagraphElement] # bug, we are entering paragraph before leaving div
dragleave[object HTMLDivElement] # bug, we leave div after entering paragraph
dragenter[object HTMLDivElement] 
dragleave[object HTMLParagraphElement] # same bug here, we enter div before leaving paragraph
dragleave[object HTMLDivElement]

On almost every platform I've worked on, drag'n'drop events are messed up in minor ways like this, it'd be nice if you guys fixed it. Attached is a simple page that demonstrates the bug.
This is not a bug; it's in the spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#drag-and-drop-processing-model

In the second list of steps (the ones repeated regularly), step 3 fires the dragenter, and then step 4 fires the dragleave.

Comment 2

6 years ago
See also https://bugzilla.mozilla.org/show_bug.cgi?id=619703, I think this is a duplicate. (This ordering can actually make it easier to deal with leave events triggered on a parent when the mouse enters a child — [enter (parent), enter (child), leave (parent)] can be detected as mouse still in parent whereas [enter (parent), leave (parent), enter (child)] could cause mayhem especially if the child element is removed when the drag leaves the parent.

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 619703
You need to log in before you can comment on or make changes to this bug.