Last Comment Bug 481737 - ondragleave and ondragexit not getting called when dragging out of one presentation shell into another
: ondragleave and ondragexit not getting called when dragging out of one presen...
Status: RESOLVED FIXED
[fixed in bug 591249]
: regression
Product: Core
Classification: Components
Component: Event Handling (show other bugs)
: unspecified
: x86 All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on: 591249
Blocks: 493412 130078 widget-removal
  Show dependency treegraph
 
Reported: 2009-03-05 14:24 PST by Erik Staats
Modified: 2011-09-29 18:33 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Test file to reproduce bug. (613 bytes, application/x-gzip)
2009-03-05 14:25 PST, Erik Staats
no flags Details

Description Erik Staats 2009-03-05 14:24:57 PST
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.6) Gecko/2009011912 Firefox/3.0.6

This bug occurs when multiple presentation shells are present in the application, such as browser1 containing browser2.  If a drag session is started and the mouse is moved into browser2, dragleave and dragexit events are sent to elements within browser2 as long as the mouse stays in browser2.

If the mouse is moved out of browser2 into the enclosing browser1, dragleave and dragexit events are not sent to elements in browser2.

Reproducible: Always

Steps to Reproduce:
1. Launch Firefox 3.0.6 or Minefield 3.2a1pre 20090305 from a console.
2. Set browser.dom.window.dump.enabled pref to true.
3. Open the test1.xul file from the bug attachment.
4. Select some text and drag it into the test2 box displayed in test1.xul.
5. Drag the text down outside of the test2 box.
6. Drag the text back into the test2 box.
7. Drag the text up out of the test2 box.
Actual Results:  
In step 5, "leave2" and "exit2" are displayed on the console.  In step 7, they are not.  Also, "leave2" and "exit2" are displayed when entering the test2 box.

Expected Results:  
In step 7, "leave2" and "exit2" are displayed on the console.

PresShell::HandleEvent must send the drag exit event to the presentation shell containing the previous mouse coordinates.  However, it sends all events, including drag exit, to the presentation shell containing the current mouse coordinates.

The state required to route the event to the proper location is maintained in nsEventStateManager objects.  Each presentation shell has its own nsEventStateManager object.  Thus, by sending the drag exit event to the wrong presentation shell, the wrong state is used and the event does not get to the proper element.

Interestingly, mouseout events do get sent to the proper location.

Due to this bug, :-moz-drag-over styling does not work properly and the styling will not be removed in the cases where the dragexit event does not fire properly.  Note that the drag over styling of the boxes will not work at all in Minefield due to bug 481727.
Comment 1 Erik Staats 2009-03-05 14:25:28 PST
Created attachment 365739 [details]
Test file to reproduce bug.
Comment 2 Alex Vincent [:WeirdAl] 2009-03-06 07:53:10 PST
I think I've seen this myself with FF3.1b2 builds, but I hesitate to confirm it because I don't have my testcase handy (and yours is zipped up).
Comment 3 Karl Tomlinson (:karlt) 2011-02-14 15:01:12 PST
This is why we don't get dragleave events when dragging between chrome and content.
Comment 4 Karl Tomlinson (:karlt) 2011-02-14 15:42:46 PST
The loss of dragleave when dragging between chrome and content is a regression from bug 130078.  Before that chrome and content had separate widgets that sent drag exit events to their separate event state managers.

The loss of dragleave when dragging between iframes would be a regression from bug 352093 for the same reason.
Comment 5 Karl Tomlinson (:karlt) 2011-09-29 18:33:31 PDT
I this this should be fixed by the changes in bug 591249.

Note You need to log in before you can comment on or make changes to this bug.