New issue
Advanced search Search tips

Issue 795179 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug-Regression



Sign in to add a comment

PointerLock inconsistent movement values

Reported by blakjak...@gmail.com, Dec 15 2017

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 10176.13.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.24 Safari/537.36
Platform: 10176.13.1 (Official Build) beta-channel cave

Steps to reproduce the problem:
1. Having acquired PointerLock, output the movementX/Y values
2. Move the mouse/touchpad at a constant slow speed up/down/left/right 
3. move the mouse/touchpad at a constant faster speed up/down/left/right

What is the expected behavior?
all directions should produce a similar movement offset at each speed.

What went wrong?
When moving the mouse quickly the movementX/Y values are in the same scale in all directions.

When moving slowly left / up the movementX/Y values are consistent with the speed of the mouse, but the right/down values are significantly lower than expected.

Did this work before? Yes Chrome 63.0.3239

Does this work in other browsers? N/A

Chrome version: 64.0.3282.24  Channel: beta
OS Version: 10176.13.1
Flash Version: N/A

The effect is similar to using PointerLock in an element near the edge of the screen - Wherein the distance to the edge of the screen becomes the maximum movementX/Y value in that direction, but the other direction permits full movement
 
This demo from MDN shows the problem.

https://mdn.github.io/dom-examples/pointer-lock/

Click into the box, move the mouse in small, slow circles. the movement down/right is significantly slower than the movement up/left, from the same input. 




Comment 2 by erich...@swbell.net, Dec 16 2017

Try this older Quake 3 webl demo with pointer lock:
http://media.tojicode.com/q3bsp/

  When you click inside the window, try rotating the camera 360 with your mouse - it has severe problems, it will hiccup, stutter and reset to previous starting position.  Please fix this soon, none of my webgl demos on my github page are working because of this issue.
Thank you
Further information: 
because this completely breaks my workflow, I've switched to the stable channel (Chrome 62), and this is functioning correctly. 

Also tested on Chrome 64 on Ubuntu 14.04, 16.04 and Window 10. in all cases the mouse movement reports correctly, so this looks like it might be a ChromeOS only issue.
Components: -Blink>Input Blink>Input>PointerLock
Owner: eirage@chromium.org
Status: Assigned (was: Unconfirmed)
Ella can you investigate this on Chrome OS?
I can confirm this issue is present in Version 63.0.3239.84 on Windows 10 (Fall creators update) 

The mouse is basically teleporting. This issue is only present in Chrome.




2018-01-03 02-02-02.mp4
15.9 MB Download
Yes, upon further investigation, ever since I installed the Fall Creator's update on Windows 10 (on my Toshiba Portege z935 laptop), the mouse capture has been malfunctioning in Chrome. Everything worked perfectly before this update.

Thanks for looking into this!

Comment 7 by and...@rainway.io, Jan 9 2018

Are there any updates to this? 
#6, #7: This issue is about pointer lock movement speed inconsistent in ChromeOS. I believe the position jumping issue on Windows 10 you mentioned is a different issue. That issue is fixed in M64. (See  issue 781182 ) Thanks

@eirage, yes I was looking for the position jumping  issue 781182  - thank you for the clarification and the link!
Project Member

Comment 10 by bugdroid1@chromium.org, Jan 16 2018

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

commit 0b0b64bb42e0341bdf30cfe9896821d84bda942a
Author: Ella Ge <eirage@chromium.org>
Date: Tue Jan 16 16:40:19 2018

Use integer subtraction to calculate movement_x/y

This CL changes the calculation of movement_x/y from
"floor(cur_pos - last_pos)" to "floor(cur_pos) - floor(last_pos)"

We store mouse event coordinates as pointF,
If we have mouse move like: 0 -> 1.4 -> 2.8 -> 4.2
"floor(cur_pos - last_pos)" will get movement:
0->1.4=1; 1.4->2.8=1; 2.8->4.2=1. in total is 3.
So that'll lose fraction part movement.
To get correct movement_x/y, need to use
"floor(cur_pos) - floor(last_pos)" instead.

Bug:  795179 
Change-Id: Iabae78962541cacc9f6a79eb0290a610f1818f02
Reviewed-on: https://chromium-review.googlesource.com/862903
Commit-Queue: Ella Ge <eirage@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529440}
[modify] https://crrev.com/0b0b64bb42e0341bdf30cfe9896821d84bda942a/content/browser/renderer_host/render_widget_host_view_event_handler.cc
[modify] https://crrev.com/0b0b64bb42e0341bdf30cfe9896821d84bda942a/third_party/WebKit/LayoutTests/NeverFixTests
[modify] https://crrev.com/0b0b64bb42e0341bdf30cfe9896821d84bda942a/third_party/WebKit/LayoutTests/external/wpt/pointerlock/movementX_Y_basic-manual.html
[add] https://crrev.com/0b0b64bb42e0341bdf30cfe9896821d84bda942a/third_party/WebKit/LayoutTests/external/wpt_automation/pointerlock/movementX_Y_basic-manual-automation.js

Status: Fixed (was: Assigned)

Sign in to add a comment