Closed Bug 603550 Opened 15 years ago Closed 15 years ago

No longer auto-capturing mouse move events on the content window / dragging an jQuery UI draggable element does not work correctly when mouse moves outside the window

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: redneb8888, Assigned: smaug)

References

()

Details

(Keywords: regression, testcase)

Attachments

(7 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0b6) Gecko/20100101 Firefox/4.0b6 Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b6) Gecko/20100101 Firefox/4.0b6 jQuery UI offers a method called draggable that makes any element draggable. In olders versions of firefox as well as in other browsers (Chrome, Opera), when the mouse moves outsides the window while an object is being dragged, then the object continues to move. This doesn't happen under firefox 4.0 beta 6. The same issue also appears with the draggable method in scriptaculous. You can verify that with the following demo: http://wiki.github.com/madrobby/scriptaculous/draggable When the new (and non-standard methods) setCapture/releaseCapture are called from the mousedown/mouseup events then everything works fine. Reproducible: Always
Attached file test case
This is a more simple test case for the problem. It works correctly under the following browsers: Firefox 3.0-3.6 Chrome 4.0+ Opera 9.2+ but not under Firefox 4. If the 2 lines with the setCapture/releaseCapture calls are re-enabled then it also works under Firefox 4.
blocking2.0: --- → ?
Regression range would be great. Did setCapture implementation cause this or something else?
Regression range from cached m-c hourly build: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=01fa971e62ee&tochange=0886ad6e6aaa Local build; Build from 7804b5cf4313 : testcase Fails Build from 687b70fea4d0 : testcase Fails Build from 4722b491cd0d : testcase works Candidate regression ; Bug 130078
Widgets automatically do mouse capturing. When the content area had its own widget before bug 130078, auto-captured mouse events outside the content area were sent to the document object of the content page. Now that the widget is gone they're only captured on the chrome XUL document and not sent to the content page any more. http://news.qooxdoo.org/mouse-capturing (from October 2009) says: > If a mouse button is pressed and dragged out of the browser window, Firefox > will continue to fire mouse events on the document. Opera, Safari and Chrome > are a little more tolerant and fire the events on the document.documentElement > as well.
Blocks: 130078
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: dragging an jQuery UI draggable element does not work correctly when mouse moves outside the window → No longer auto-capturing mouse move events on the content window / dragging an jQuery UI draggable element does not work correctly when mouse moves outside the window
Assignee: nobody → tnikkel
blocking2.0: ? → betaN+
Depends on: 582771
The changes how to handle activeESM (bug 582771) should be helpful here.
Assignee: tnikkel → Olli.Pettay
Status: NEW → ASSIGNED
Attached file testcase with iframe
This is a case where Gecko and Webkit work the same way but IMHO Opera has the sane behavior. With Opera it is possible to "drag" the rectangle over iframe.
Attached patch possible patch (Opera behavior) (obsolete) — Splinter Review
If we want to keep the current mouseover iframe behavior, it is enough to move the code to happen after if (shell != this) { } About to post the patch to tryserver.
Comment on attachment 483442 [details] [diff] [review] possible patch (Opera behavior) Oops, the patch breaks event targeting somehow.
Attachment #483442 - Attachment is obsolete: true
Webkit doesn't like this one. It behaves inconsistently depending on where the mouse is. Opera works well.
Attached patch patchSplinter Review
Targets events to (i)frame if mouse is over a subdocument, and to document if mouse is outside the document presentation. IMHO targeting document.documentElement doesn't make much sense if mouse is actually outside of its presentation. So this brings back the old behavior when mouse is outside the document, but adds new Opera-like behavior when mouse is over a subdocument. Mochitests are still needed.
Attachment #483475 - Flags: review?(roc)
It seems that test_selection_expanding.html doesn't like the patch. Investigating.
Perhaps for FF4 it would be better to not change behavior, and just leave the (i)frame handling the way it is.
I don't really understand what's going on here. Are you suggesting we do nothing for FF4? Can you be more precise about what this patch actually does?
sorry, I should have cleared the review request. I'm suggesting that we take the part of the patch which handles the case when mouse moves outside the "active" document. But no need to change how moving mouse over iframe works. That approach should give us ff3.6 behavior. post ff4 we could fix mouse-over-iframe to work like in Opera.
Comment on attachment 483475 [details] [diff] [review] patch OK, so I guess you're going to attach a new patch.
Attachment #483475 - Flags: review?(roc)
Attached patch patchSplinter Review
Attachment #483743 - Flags: review?(roc)
(Still missing mochitests, which I need to write before pushing the patch - if the patch gets a review)
Attached patch +testSplinter Review
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Depends on: 606192
Broken again. Works; http://hg.mozilla.org/mozilla-central/rev/6e70eb8a5271 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101020 Firefox/4.0b8pre ID:20101020092853 Broken; http://hg.mozilla.org/mozilla-central/rev/91a2567620be Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101020 Firefox/4.0b8pre ID:20101020110243 Pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6e70eb8a5271&tochange=91a2567620be Regressed by Bug 605242 - No :active state for <button> Should I filed separately? OR Reopen this?
I think I'll backout this and the rest of bug 605242.
Oh, the regression was a silly mistake when commitin, I think. Fixing. But I may still backout this one to get the d-n-d/clicking working again properly on Windows.
Btw, Alice, thanks for testing this all!
(In reply to comment #23) > Oh, the regression was a silly mistake when commitin, I think. Fixing. Er, no. It is needed after all. Uh, it is a bit difficult to emulate the used-to-be-handled-by-native-widget things. Still investigating..
And the reason why the test didn't capture the regression is that the test doesn't check whether preventDefault() affects to the mouse event handling in this case. My bad.
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: