[csswg-drafts] [cssom-view] Add pageZoomFactor to window interface (#3538)

EiraGe has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom-view] Add pageZoomFactor to window interface ==
`window.devicePixelRatio` includes both the device scale and the page zoom. However, there is no easy way to get the page zoom factor alone. 

Developers use different ways to get the zoom factor, but they are either inaccurate or not specced
(e.g window.outerWidth / window.innerWidth, and window.getComputedStyle()['zoom'])

In addition, as mentioned in this [comment](https://github.com/w3c/uievents/issues/150#issuecomment-455258687), `event.screenX/Y` are in DIP(device independent pixels), which includes zoom, and `clientX/Y` are in CSS pixel. Lacking page zoom factor causes developer having trouble converting between the coordinates spaces.

I therefore propose adding a new **window.pageZoomFactor** to expose the zoom factor.



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3538 using your GitHub account

Received on Monday, 21 January 2019 14:42:32 UTC