[csswg-drafts] [cssom-view] No event to track window position (#7693)

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

== [cssom-view] No event to track window position ==
[The window object exposes](https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface) attributes to find the position (and size) of the window. However, there are no corresponding event, so anyone interested in tracking these must do so by actively polling, which is wasteful and/or laggy, depending on how frequently you poll.

A use case for doing this is when a parent page pops up an child window, and wants to keep it positioned to a particular spot relative to the parent window. That's currently doable, but it takes active polling. Being able to switch to an event would be good.

We already do have the resize event on the Window object, but that only solves half the problem, as there's no equivalent for the position.

So, can we get

```js
window.addEventListener('move', callback);
```
to go along with

```js
window.addEventListener('resize', callback);
```
?

----
cc: @emilio @mrego 

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 5 September 2022 02:47:51 UTC