Bug 211101

Summary: Event timestamps are incorrect (off by almost exactly 31 years)
Product: WebKit Reporter: Philip Walton <philip>
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: bburg
Priority: P2    
Version: Safari 13   
Hardware: Unspecified   
OS: Unspecified   

Description Philip Walton 2020-04-27 16:19:29 PDT
I'm testing some code in Safari using webdriver that compares `event.timeStamp` to `performance.now()`, and I've noticed that the `event.timeStamp` values are way off.

Here is a log of a few values I'm seeing reported in an event listener:

event.timeStamp: 609714965503,
Date.now(): 1588028638216,
performance.now(): 105,

Interestingly (not sure if it's a coincidence), the value reported by event.timeStamp is a valid timestamp, and it's actually a timestamp for the same Month and Date as today, it's just 31 years off:

new Date(609714965503)
// Thu Apr 27 1989 14:16:05 GMT-0700 (Pacific Daylight Time)
new Date(1588028638216)
// Mon Apr 27 2020 16:03:58 GMT-0700 (Pacific Daylight Time)


NOTE: this behavior only occurs when Running Safari via webdriver (using https://webdriver.io/). It does not happen when using the Safari browser.