Closed Bug 527749 Opened 13 years ago Closed 12 years ago
Drag events out of order
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:220.127.116.11) Gecko/20090824 Firefox/3.5.3 Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:18.104.22.168) Gecko/20090824 Firefox/3.5.3 The drag-and-drop processing model used in Firefox does not conform to section 7.9.4 of the HTML 5 spec. <http://dev.w3.org/html5/spec/Overview.html#drag-and-drop-processing-model>. In particular, the order of dragenter and dragleave events are reversed in Firefox. That is, Firefox fires dragleave then dragenter, but it should be dragenter then dragleave. This issues is similar to an drag event ordering issue in WebKit bug #30754 <https://bugs.webkit.org/show_bug.cgi?id=30754>. Reproducible: Always
Test case derived from a similar WebKit test.
Confirmed on trunk.
Status: UNCONFIRMED → NEW
Component: General → Drag and Drop
Ever confirmed: true
OS: Mac OS X → All
Product: Firefox → Core
QA Contact: general → drag-drop
Hardware: x86 → All
Version: unspecified → Trunk
http://mxr.mozilla.org/mozilla-central/source/content/events/src/nsEventStateManager.cpp#3812 Should be a pretty simple fix.
Probably a quick fix for somebody familiar with the code and an HTML5 compliance win. Nominating for blocking.
blocking2.0: --- → ?
need a dupeme maybe, But also I think trunk is correct.
oops sorry missed comment 2
Enn, can you take this? (And hopefully get a test into the HTML test suite, if such a thing exists.)
Assignee: nobody → enndeakin
blocking2.0: ? → betaN+
This patch moves the dragleave event to fire after the dragenter event. For developers that want the more sensible event order, including the places in browser, editor and toolbar customization code, the dragexit event still fires before the dragenter event as before. The event order then is: dragexit, dragenter, dragleave Can't be tested automatically. Works with the testcase.
This is rather strange. Why should dragenter fire before dragleave? Is this something that IE does always? I guess I need to test IE. Could we just change HTML5 draft?
IE always fires dragenter before dragleave. About a year ago, Webkit was changed to this behaviour as well. Changing our behaviour could have compatibility issues for us which is why I had to change code to use the dragexit event. Likely though, there would be less of a problem to go from the IE behaviour to our behaviour as I can't see why the unusual event order would be useful and relied on.
Yeah the IE behaviour (and thus the spec) is pretty nutty here. dropexit seems like a reasonable idea; if you'd like it formalised and specced please feel free to mail the WHATWG list mentioning it.
Attachment #492371 - Flags: review?(Olli.Pettay) → review+
Whiteboard: [needs review smaug]
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
You need to log in before you can comment on or make changes to this bug.