Bug 210454 - Implement rAF-aligned Pointer/Mouse/Touch events (getCoalescedEvents())
Summary: Implement rAF-aligned Pointer/Mouse/Touch events (getCoalescedEvents())
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2020-04-13 13:36 PDT by Dean Jackson
Modified: 2024-01-08 04:22 PST (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2020-04-13 13:36:40 PDT
Implement rAF-aligned UI events.


See 
- https://w3c.github.io/pointerevents/ and wording on coalescing and aligning
- https://www.chromestatus.com/feature/6192761317359616
- Firefox also implemented it even though the page above doesn't currently mention that
Comment 1 Radar WebKit Bug Importer 2020-04-13 13:37:02 PDT
<rdar://problem/61734836>
Comment 2 Ryosuke Niwa 2020-08-12 13:00:11 PDT
I don't follow this. What is being coalesced and how?
Comment 3 Simon Fraser (smfr) 2020-08-12 13:34:06 PDT
You can coalesce multiple pointermove and pointerrawupdate events in the same event loop:
https://w3c.github.io/pointerevents/#dfn-coalesced-event-list
Comment 4 Ryosuke Niwa 2020-08-12 13:37:52 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> You can coalesce multiple pointermove and pointerrawupdate events in the
> same event loop:
> https://w3c.github.io/pointerevents/#dfn-coalesced-event-list

But how does this integrate with the event loop? The spec doesn't seem to say anything about how events are coalesced.
Comment 5 Simon Fraser (smfr) 2020-08-12 14:26:47 PDT
https://github.com/w3c/pointerevents/issues/328
Comment 6 Sam Sneddon [:gsnedders] 2021-12-02 14:07:12 PST
AIUI, there's no actual definition about how the coalescing happens. The spec has this because at least Android and iOS do this, and it's basically left down to the browser how often to actually fire events. Clearly, the browser can't fire events more often than it gets them from the OS.

In the iOS case, see https://developer.apple.com/documentation/uikit/touches_presses_and_gestures/handling_touches_in_your_view/getting_high-fidelity_input_with_coalesced_touches

In short:

> UIKit usually delivers touches to your app at around 60 Hz, but some devices are capable of recording touch information at up to 240 Hz.
Comment 7 Karl Dubost 2023-10-30 02:14:38 PDT
A section has been added about coalesced events
https://w3c.github.io/pointerevents/#coalesced-events

aka getCoalescedEvents()