User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:188.8.131.52) Gecko/2009011912 Firefox/3.0.6
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:184.108.40.206) 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.
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.
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.
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.
Created attachment 365739 [details]
Test file to reproduce bug.
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).
This is why we don't get dragleave events when dragging between chrome and content.
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.
I this this should be fixed by the changes in bug 591249.