Closed Bug 1457859 Opened 7 years ago Closed 4 years ago

PointerEvent.getCoalescedEvents timeStamps are zero

Categories

(Core :: DOM: Events, defect, P3)

59 Branch
defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: mahlen, Assigned: smaug)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 Build ID: 20180323154952 Steps to reproduce: The steps to reproduce 1. Open firebug (or similar tool) 2. Apply the listener for pointermove, document.addEventListener("pointermove", (e) => { var c = e.getCoalescedEvents(); if (c) { console.log(e.timeStamp, c.map(x => x.timeStamp)) } }) that log the event's timeStamp and the timeStamps of the coalesced events. 3. Move the mouse in the page to trigger the event(s). Actual results: The logged events prints the handler's event timeStamp (milliseconds elapsed from the beginning of the current document's lifetime till the event was created) and the array of coalesced events all are zero. Example: 2360 Array [ 0, 0, 0 ] Expected results: The coalesced events returned should have a timeStamp that represents the actual timing of the event, to follow the specification [1] and is also the behavior of Chromium. Example: 2360 Array [ 2358, 2359, 2360 ] [1] https://w3c.github.io/pointerevents/extension.html#x2-extensions-to-the-pointerevent-interface
Blocks: 1303957
Component: Untriaged → DOM: Events
Product: Firefox → Core
Priority: -- → P3
I confirm, bug still exists in version 63.0.
Just ran into this on https://canvas.apps.chrome/ As a workaround, I can check if timestamps are 0 and ignore the coalesced events, which reduces drawing precision. It would be better to have the full set of events though, especially if high-report-rate devices like styluses are supported in Firefox.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → bugs
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7e991bb4bfba PointerEvent.getCoalescedEvents timeStamps are zero, r=edgar

Thanks for looking at this, Olli!

Does this patch mean that all of the coalesced events will now have the same timestamp (that of the parent event) rather than 0? That's not a whole lot better from my perspective. My code will discard any events with duplicate timestamps (otherwise I end up calculating an infinite velocity between points!). It would be very useful for the coalesced events to have their original timestamps intact.

They should have the timestamp they got when the (coalesced) event was created on OS level, so no duplicates unless the events occurred pretty much the same time.

Perfect, thank you!

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: