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

Should events queue a task? #197

Open
jakearchibald opened this issue Apr 21, 2017 · 8 comments
Open

Should events queue a task? #197

jakearchibald opened this issue Apr 21, 2017 · 8 comments
Labels

Comments

@jakearchibald
Copy link
Contributor

https://w3c.github.io/pointerevents/#the-pointermove-event - because the event is dispatched when "a pointer changes coordinates", it doesn't really fit in with the event loop.

Ideally the spec should queue a task for event dispatching, which clarifies:

  • What happens if there are many pointer events in the queue - can the browser update rendering in between them? If not, the spec should queue a single callback to dispatch the events that must happen before rendering.
  • Should/may the browser queue multiple pointermove events for a given frame?
@dtapuska
Copy link

dtapuska commented Apr 21, 2017

This sounds like you want to specify the lifecycle of dispatching input events. For Chrome we are working on dispatching the pointer events just before the rAF signal. M58 has touch events dispatched before the rAF signal, mouse is an an experiment.

See issue w3c/uievents#23

@jakearchibald
Copy link
Contributor Author

For move events, does that mean one move per raf signal, or would you get a batch of them? The downside of one-move you may lose some fidelity in a painting application, eg if the user moves faster than the display refresh rate. I guess that could be fixed later by calling something like pointerEvent.superHighFrequencyPlease() during the pointerdown event.

If syncing to raf becomes the right thing to do, https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model should be updated to clarify the ordering in regards to resize/scroll events.

@dtapuska
Copy link

@jakearchibald
Copy link
Contributor Author

Haha seems everything I'm thinking of is in-progress.

@dtapuska
Copy link

One better it is shipped in Chrome M58 for touch. I was waiting to write a dev rel article on it until we shipped mouse.

@patrickhlauke
Copy link
Member

x-ref #9 ?

@patrickhlauke
Copy link
Member

@dtapuska @jakearchibald is there any need for a further change in the spec text here, or does https://w3c.github.io/pointerevents/extension.html#timing-of-coalesced-event-firing cover your concern sufficiently?

@patrickhlauke
Copy link
Member

In today's PEWG meeting we agreed that this, at this point, is not a v3-related issue. Once the lower-level issue of when events are dispatched (possibly UI events?) is addressed, it may require the spec to mention it in pointerraw. keeping this open, but marked as "Future"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants