Mouse events not reliably captured when pointer leaves browser window




13 years ago
9 years ago


(Reporter: a507, Unassigned)


1.8 Branch
Windows XP

Firefox Tracking Flags

(Not tracked)





13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060111 Firefox/
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060111 Firefox/

When listening to mouse events "mouseup" and "mousemove" in capture mode, a program cannot count on receiving events once the pointer has left the browser window.

Whether or not events are reported seems to depend on the type and configuration of the element whose "mousedown" handler added listeners for the up and move events. Some cases I have enumerated:

1) div with content works
2) div with no content does not work
3) image does not work
4) div contained in another div with overflow=auto works for text
5) div contained in another div with overflow=auto with added br tag fails

See the reference URL for demonstrations.

Reproducible: Always
Assignee: nobody → events
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → 1.8 Branch

Comment 1

13 years ago
Found a way to make a non-working case work one time...

1) Drag from a working case element to outside the browser window and release the mouse button there. Status should show that mouse button was released.

2) Try a non-working case. It will work one time only.

I can't reproduce with the testcase. However, this seems similar to bug 294844.

Comment 3

13 years ago
Related to bug 272897?
The mouse capture behavior has changed quite considerably on trunk. Now none of the cases in the linked testcase work. This is very likely due to the changes made by Robert in bug 317375. The only testcase I know to work now is bug 294844 attachment 184050 [details].
Ever confirmed: true
Martijn, jwatt, do you think this is a bug or not? From bug 294844 I presume that Martijn says no and Jonathan says yes :-). What do other browsers do?
Over the years I've encountered the need to capture mouse events from outside the browser window time and again, so for me, this is definitely a bug. On the other hand (although I've not encountered it myself) Frank's use case from bug 294844 comment 4 does seem legitimate. I think that like Martijn I'd like to see this be more controllable. I have a proposal for that, but I'll make it in bug 294844.

As for what other browsers do, the testcases simply don't work in IE, and Opera 9 seems somewhat broken. On this bug's URL it seems to allow dragging outside the window both below and above the window, so long as the cursor doesn't move left of the left border or right of the right border. Very strange.
Assignee: events → nobody
QA Contact: ian → events
You need to log in before you can comment on or make changes to this bug.