getCoalescedEvents method
The getCoalescedEvents()
method of the PointerEvent interface
returns a sequence of PointerEvent
instances that were coalesced
(merged) into a single Element.pointermove_event
or
Element.pointerrawupdate_event
event.
Instead of a stream of many Element.pointermove_event
events, user
agents coalesce multiple updates into a single event.
This helps with performance as the user agent has less event handling to
perform, but there is a reduction in the granularity and accuracy when
tracking, especially with fast and large movements.
The getCoalescedEvents()
method lets applications access all
un-coalesced position changes for precise handling of pointer movement
data where necessary.
Un-coalesced position changes are desirable in drawing applications, for
instance, where having access to all events helps to build smoother curves
that better match the movement of a pointer.
For an illustration of coalesced events, see Figure 7 in the specification.
Implementation
external JSArray<PointerEvent> getCoalescedEvents();