New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 750455 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Mousemove event outside window not fired after mousedown. (i.e. while dragging)

Reported by web.acce...@gmail.com, Jul 29 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36

Steps to reproduce the problem:
1. Open the attached html file in Chrome 60 and watch console messages. 
2. Press and hold the left mouse button and move the mouse outside the window. (i.e. perform a drag gesture)

What is the expected behavior?
While performing a drag operation mousemove events should be fired even when the mouse cursor is outside the window.

What went wrong?
No mousemove events are fired when the mouse cursor is outside the window while performing a drag operation.

Did this work before? Yes Not sure. 59, I guess.

Does this work in other browsers? Yes

Chrome version: 60.0.3112.78  Channel: stable
OS Version: 
Flash Version: 

IMHO this is a serious regression as the expected behaviour is necessary for all kinds of drawing operations. Think of a selection rectangle to select visual items or a drawing tool.
 
mousemove.html
867 bytes View Download
In Firefox this works just fine. 
Update: This seems to be "only" a Linux problem.
On macOS and Windows the mousemove event still fires while dragging. 

However, on Linux (Xubuntu 16.04) the issue seems to be worse as there seems to be a related issue: 
You cannot scroll a page while selecting text anymore. 

Steps to reproduce: 
1. Open any scrollable page with text that can be selected. 
2. Try to select all text with your mouse only

What is the expected behavior?
The page should scroll when the mouse cursor is outside/underneath the window when selecting text

What went wrong: 
The page doesn't scroll.

Labels: Needs-Triage-M60
Cc: hdodda@chromium.org
Labels: Needs-Feedback
Tested the issue on ubuntu 14.04 using chrome M60 #60.0.3112.78 and latest stable M60 #60.0.3112.90 and followed steps mentioned in comment #0.

Observed same behavior in chrome and firefox.

Attached screencast for reference.

@web- Could you please check attached screencast and update your chrome to latest stable and verify if you can reproduce the issue in a fresh chrome profile without any extensions and flags enabled and update us with your observations.

Thanks!
750455.ogv
2.6 MB View Download
@hdodda I checked your screencast. Are your sure that all mousemove events (not mouseup events) are fired when the cursor is outside(!) the window during a drag operation?
By drag operation I mean this sequence of events: mousedown->mousemove->mouseup.
The browser window seems to be maximized in your screencast.

I attached a screencast myself recorded with Chrome Version 60.0.3112.78 (same version as you have) on Ubuntu 16.04. All extensions disabled, and all chrome flags set to defaults.

As you can see, no mousemove events are fired when the cursor is outside the window during a drag operation in Chrome. In Firefox mousemove events are fired as expected.

Is this just me? Or can someone else confirm this issue. Thank you!


mousemove.mkv
835 KB Download
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 4 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "hdodda@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: Blink>Editing>Selection
Tested the issue again on ubuntu 14.04 using chrome M60 #60.0.3112.90 and no luck in reproducing the issue.

Observed same behavior in chrome and firefox.

Attached screencast for reference.

@Could soemone from dev please look into this.

Thanks!
750455_1.ogv
5.7 MB View Download
@hdodda: Thank you for testing again. 

However, I believe that your testing already reproduces the issue: 
You made the test on Chrome twice. In both cases the reported y position of the mouse is not smaller than -80/-81. 
Which is more or less the relative y position of the upper edge of the browser window (but not the actual relative position of your mouse when you release the button).

Your test on Firefox on the other hand shows a reported y position of -156 when you release the mouse button. Which seems to be the correct relative position of the mouse cursor.

You could test this again to see if you can report y positions smaller than -150 on Chrome? Or x positions smaller than -20. Or just make some mouse cursor movements outside of the browser window BEFORE you release the mouse button. My guess is nothing will be logged in the console while the mouse cursor is outside the window.

Thanks!

Comment 9 by yosin@chromium.org, Aug 9 2017

Components: -Blink>Editing>Selection Blink>Input
Route to input team, it seems mouse capture related.
Cc: nzolghadr@chromium.org dtapu...@chromium.org
Owner: eirage@chromium.org
Status: Assigned (was: Unconfirmed)
We can reproduce it here on bokan's laptop.

eirage@ can you investigate?
Labels: Hotlist-Input-Dev
web...@ do you have a particular use case that needs this behavior? Sending the events to the window while we are moving the mouse outside the boundaries of it seems like a hack that we did. It is similar to an normal element inside the html. If the mouse is not inside the boundaries it would get any events even though you might have pressed the mouse inside the element.
We introduced a new API for this behavior to make it more logical and predictable and it is called setPointerCapture as part of the pointerevents. Is that something you can use?
#12 - regardless of the use case, Chrome should be consistent across platforms (and interoperable). The reporter claims that it works on non-Linux platforms (as well as using Firefox), so Chrome should be consistent and work on Linux as well.
#12. I have to admit that I didn't know about setPointerCapture. setPointerCapture is indeed something that I can use to solve my specific problem. Thank your very much for pointing that out! setPointerCapture seems to capture pointer events even if the mouse leaves the window.

However I also agree with #13: Chrome should be consistent across different platforms. 

As for a particular use case, please try this demo: http://fm.devale.pro/ (I am not affiliated!)
Draw a rectangular selection box to select multiple files/folders. 
In Firefox on Linux, even if your mouse pointer leaves the window the rectangle is drawn correctly. 
In Chrome on Linux, the rectangle is not updated as soon as the mouse pointer leaves the window, which doesn't feel right.

I guess the guys behind that demo could use setPointerCapture to fix this as well.


I'm seeing this a well. Very simple test/usecase:
Load Google Maps. Click the mouse to start dragging the map and move the mouse pointer outside of the Window.

On Chrome on Windows, OS X, and Chrome OS, the map continues tracking the mouse after it has left the window. Same with Firefox on Linux. On Linux Chrome, however, the map stops panning as soon as the mouse has left the browser window.

Comment 16 by 8998...@gmail.com, Jan 7 2018

I would like to add that this is also broken on windows if a drag is started with a right click instead of a left click (works correctly in Firefox).

I.e. no mousemove events are generated if the right (or middle) mouse button is pressed down and dragged outside the Chrome browser window.
Project Member

Comment 17 by bugdroid1@chromium.org, Feb 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7a6ebf35422b7320932f8a9d644367d04487efc2

commit 7a6ebf35422b7320932f8a9d644367d04487efc2
Author: Ella Ge <eirage@chromium.org>
Date: Fri Feb 09 19:36:59 2018

Do not clear mouse_pressed_ on MouseLeave

On Linux, when pressed button and move out of page, we get a MouseLeave
event when cross the window boundary. In that case, we don't want to
reset the mouse_pressed_. Because we should still fire mousemove event
when button down and move out of window. Reset mouse_pressed_ here
causes selection stop when drag selecting and move out of window.

Since we always clear mouse_pressed_ on mousemove event with no button
down, we don't need to reset it here. So just return kNotHandled.

Bug:  750455 
Change-Id: Iaecc0245a3d45e593f438d56081a6e51984390ed
Reviewed-on: https://chromium-review.googlesource.com/902772
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535786}
[modify] https://crrev.com/7a6ebf35422b7320932f8a9d644367d04487efc2/third_party/WebKit/Source/core/input/MouseEventManager.cpp

Labels: TE-Verified-M66 TE-Verified-66.0.3345.0
Verified the fix on Ubuntu 14.04 using latest chrome version #66.0.3345.0 as per the comment #0.
Attaching screen cast for reference.
Observed that while performing a drag operation mousemove events is fired even when the mouse cursor is outside the window.
Hence, the fix is working as expected. 
Adding the verified labels.

Thanks...!!
750455.ogv
2.2 MB View Download
Status: Fixed (was: Assigned)
Thank you!

Sign in to add a comment