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

Add test for window.onmove #49390

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

Conversation

frivoal
Copy link
Contributor

@frivoal frivoal commented Nov 27, 2024

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frivoal added a commit to frivoal/html that referenced this pull request Nov 27, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants