Contact emails
maj...@chromium.org, rbyers@chromium.org
Spec
https://github.com/whatwg/dom/issues/23
Additional discussion: https://lists.w3.org/Archives/Public/public-whatwg-archive/2014May/0046.html
Summary
Change Event.timeStamp to be a DOMHighResTimeStamp which is a high resolution monotonic time with microseconds resolution instead of DOMTimeStamp which is an epoch time with millisecond resolution. For input events, the timestamp value will represent the underlying OS timestamp for the event, for any other event the value will continue to be the event creation time.
Motivation
Currently exposed event timestamp represents the dispatch epoch time, has only milliseconds resolution, and is subject to unexpected system time adjustment skews which makes it unsuitable for accurate measurement relative time between input events. Exposing platform monotonic timestamp as DOMHighResTimeStamp addresses all these issues. This change enables implementation of functionalities which are not possible today such as accurate measurement of pointer velocity, input latency measurement tools, and etc.
Compatibility Risk
Firefox: In development (Shipping by default in their Aurora channel)
Edge: No public signals
Safari: No public signals but they use platform monotonic timestamp but convert it to epoch time before exposing it.
Web developers: Positive
Mozilla is actively working to make the switch and there is consensus in DOM WG to change DOM specification to reflect this change once it is shown that potential compat issues are addressable by vendor implementations (more on this below). We believe the risk is small enough that we should try and ship it.
The compatibility risk of this change is mostly due to change in time origin from epoch time to navigation start time. There are few factors that reduce this risk:
All known use cases rely on relative time which only gets more accurate for input events and fixes time skew bugs.
Event.timeStamp has been incompatible between browsers already. Firefox uses monotonic timestamp. Safari transforms event’s monotonic platform timestamp to epoch time. Chrome return an epoch timestamp that is essentially the time of the dispatch.
Mozilla have had it in Aurora/Nightly for Windows for over a year, and for Linux for a month. So far not report of compatibility issues yet. This is small sample set but still useful.
It is easy to polyfil the old behaviour if needed.
\o/ ... this will go a long way towards helping developers accurately measure the R(esponse) component of RAIL. +1.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Just make sure this is clamped in the same way that performance.now() is, we really need to get that moved into a shared helper that all systems use. :)
Contact emails
maj...@chromium.org, rby...@chromium.org
We have identified some compatibility issues with this feature that, imo, could have wide-reaching impact and cannot be easily detected (both in terms of usage and breakage). As requested by rbyers, I'm the discussions cross-posting here.