W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2020

[csswg-drafts] [CSSOM] There is no way to get correct viewport position in relation to the screen (#5814)

From: ArkadiuszMichalski via GitHub <sysbot+gh@w3.org>
Date: Mon, 21 Dec 2020 13:19:45 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-772164084-1608556784-sysbot+gh@w3.org>
ArkadiuszMichalski has just created a new issue for https://github.com/w3c/csswg-drafts:

== [CSSOM] There is no way to get correct viewport position in relation to the screen ==
Hi, actually there is no way to get correct  viewport position in relation to the screen (I mean whole screen). We have this properties:


but the difference between `window.outerHeight - window.innerHeight` represents both toolbars (above and belove viewport).  So I can't determine how many space the top bar takes up. This is especially noticeable when something like the status bar or devs tools appear at the bottom. For this reason, I am not able to determine the position of the element relative to the entire screen (equivalence for `event.screenX` and  `event.screenY`).

Similar questions raised by the community:

The lack of such an option is made by intention? If not, one of the solutions below might fix the problem:
- add to `window` some new x/y cords that expose position viewport related to screen
- add to `element`  some x/y cords that expose position related to screen (equivalence for `event.screenX` and  `event.screenY`)
- add to window some properties that expose how much space each toolbars takes (I mean top, botoom, left and right toolbar) .

or any other that will solve the problem described here.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 21 December 2020 13:19:47 UTC

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