Re: [w3c/pointerlock] movementX/Y coordinate space (#42)

I agree with Ella re the incompatible implementations.

The current `movementX/Y` definition in the spec (difference between consecutive `screenX/Y` values) is problematic from another perspective: `screenX/Y` [spec](https://drafts.csswg.org/cssom-view/#dom-mouseevent-screenx) itself doesn't match the reality!  The spec defines `screenX/Y` as CSS pixels, but most major browsers have DIPs.  As a result, browsers have two interpretations of the PointerLock spec: implement `movementX/Y` either
- as DIPs to match most browsers' `screenX/Y`, or
- as CSS pixels to match `screenX/Y` spec.

Chrome's `movementX/Y`-in-physical-pixels clearly doesn't look great.  We want to change it, see the following possible ways forward:

1. **Modify `movementX/Y` to DIP to match `screenX/Y` reality**, and keep the PointerLock spec as is.
This has two advantages:  (i) seems like a safe change because sites shouldn't be affected by scale change in `movementX/Y`, and (ii) if we ever [change `screenX/Y` spec to DIP](https://github.com/w3c/uievents/issues/150) in future, everything will be good from spec perspective.

2. **Modify `movementX/Y` to CSS pixels to match `screenX/Y` spec**, and keep the PointerLock spec as is.
This essentially pulls the `screenX/Y` problem (that spec doesn't not matching reality, see linked issue above) into PointerLock without a clear benefit: changing most browsers' `screenX/Y` to match spec is almost impossible; hopefully one day we will change `screenX/Y` to match browsers instead, which would then call for a change of `movementX/Y` to DIPs.

3. **Change PointerLock spec to make `movementX/Y` in physical pixels**.
  This completely isolates `movementX/Y` from `screenX/Y` coordinate space (and corresponding spec-not-reflecting-reality problem).

Wondering what other browser vendors think about these three options (and possibly other we didn't see).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/pointerlock/issues/42#issuecomment-476263544

Received on Monday, 25 March 2019 16:02:17 UTC