-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setting a flag, so that the first movement will have the correct value #13082
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
741f842
to
b8ca2b1
Compare
Out of curiosity, can you make some browser testing and see what browser gives us for the first event, when this property is supported natively? |
As far as I can tell, the initial movement is always 0, using this method:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, this looks correct. However I will not be able to test in IE until tomorrow morning (Airplane wifi :()
This does, however, appear to work correctly in Safari 11.1 (Safari is the other browser that does not support movementX/Y) |
LGTM |
@gaearon @nhunzaker Chrome 67.0.3396.87 i did quite a few times, and the first hover event always had movementX at 0 Edge 42.17134.1.0 had very similar results after quite a few tries Firefox Developer Edition 61.0b14 seemed to be the outlier here, as i was getting random values each time, sometimes 13, or 18 or 12. This could be saying more about dev tools though, rather than the initial value of movementX |
Nice! This is sufficient—I think |
https://w3c.github.io/pointerlock/#extensions-to-the-mouseevent-interface
I also noticed that the spec states:
It's potentially minor but we're not restricting our polyfill |
Oh, I missed that. We should definitely limit it to |
@jasonwilliams do you want to fix this in another follow up? |
Yup I missed that too, I can take a look |
This should hopefully fix the initial movementX and movementY values introduced in #9018