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 move Event #11278

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add move Event #11278

wants to merge 3 commits into from

Conversation

frivoal
Copy link
Collaborator

@frivoal frivoal commented Nov 27, 2024

This is the CSS part of #7693. HTML part to be filed separately.

(this replaces #9664, which was trying to do it all in CSS, monkey patching HTML)

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
Copy link
Contributor

@javifernandez javifernandez left a comment

Choose a reason for hiding this comment

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

Looks good, but wouldn't be useful to have a section to define the IDL associated to that new event ? We had something similar in the previous commit.

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.

2 participants