Skip to content

[cssom-view] window.innerScreenX windows.innerScreenY #809

@JanNorden

Description

@JanNorden

For the browser as such it is possible to obtain both the dimensions and the positon on the (operating system) screen area:

https://drafts.csswg.org/cssom-view/#dom-window-outerwidth
https://drafts.csswg.org/cssom-view/#dom-window-outerheight
https://drafts.csswg.org/cssom-view/#dom-window-screenx
https://drafts.csswg.org/cssom-view/#dom-window-screenx

However, for the viewport it is only possible to obtain the dimensions, not the position:

https://drafts.csswg.org/cssom-view/#dom-window-innerwidth
https://drafts.csswg.org/cssom-view/#dom-window-innerheight

The fact that the position is not available makes it impossible to translate coordinates on the screen to coordinates in the viewport.

I therefore propose the addition of corresponding innerScreenX and innerScreenY properties.

Since this translation is already performed by e.g. window.onMouseMove(), implementing the properties should not present any new technical or conceptual challenges.

The need arises when you get (OS) screen coordinates from some non-mouse source (in our particular case an gaze-tracking device), and want to relate them to the corresponding position in the displayed document.

There are non-standard implementations, e.g. mozInnerScreenX https://developer.mozilla.org/en-US/docs/Web/API/Window/mozInnerScreenX.

A previous request for another vendor-specific implementation was declined awaiting standardization https://bugs.chromium.org/p/chromium/issues/detail?id=151983 .

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions