Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with the move event for window defined by CSSOM-View #10853

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frivoal
Copy link
Contributor

@frivoal frivoal commented Dec 12, 2024

UAs expose the coordinates of a window (window.screenX, window.screenY), enabling authors to track window movement and react to it. Without a corresponding event though, they have to resort to active polling, which is wasteful of resources, especially if done often enough to have a responsive UI.

As resolved by the CSSWG (See w3c/csswg-drafts#7693), this adds an onmove event handler to keep track changes in window position without such need for active polling. The definition of the event itself goes to CSSOM-View, along with the geometric attributes whose changes it tracks.

The privacy concerns related to exposing the window position in the first place are handled in CSSOM-View, which allows UAs to return fake information. The addition of the event doesn't change that: UAs that don't expose the real information continue not to (and the event won't fire).

See explainer at https://github.com/Igalia/explainers/blob/main/onmove-event-handler/README.md

CSS Part of the change: w3c/csswg-drafts#11278

Tests: web-platform-tests/wpt#49390

Implemented experimentally in Chrome: https://chromium-review.googlesource.com/c/chromium/src/+/6035050

(See WHATWG Working Mode: Changes for more details.)


/acknowledgements.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/sections.html ( diff )
/webappapis.html ( diff )

UAs expose the coordinates of a window (window.screenX, window.screenY),
enabling authors to track window movement and react to it. Without a
corresponding event though, they have to resort to active polling, which
is wasteful of resources, especially if done often enough to have a
responsive UI.

As resolved by the CSSWG (See w3c/csswg-drafts#7693),
this adds an onmove event handler to keep track changes in window
position without such need for active polling. The definition of the
event itself goes to CSSOM-View, along with the geometric attributes
whose changes it tracks.

The privacy concerns related to exposing the window position in the
first place are handled in CSSOM-View, which allows UAs to return fake
information. The addition of the event doesn't change that: UAs that
don't expose the real information continue not to (and the event won't
fire).

See explainer at https://github.com/Igalia/explainers/blob/main/onmove-event-handler/README.md

CSS Part of the change: w3c/csswg-drafts#11278

Tests: web-platform-tests/wpt#49390

Implemented experimentally in Chrome: https://chromium-review.googlesource.com/c/chromium/src/+/6035050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant