W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2019

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

From: Ella Ge via GitHub <sysbot+gh@w3.org>
Date: Mon, 21 Jan 2019 14:42:31 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-401383381-1548081750-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:42 UTC