Bug 185040

Summary: Regression(r222392?): Events can have a negative timestamp which causes app breakage
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, carlos.barreiro, commit-queue, dbates, esprehn+autocc, ews-watchlist, gion-andri, kangil.han, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar, Regression
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://codepen.io/cdumez/pen/xjEmdX
Bug Depends on:    
Bug Blocks: 154246    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2018-04-26 12:41:43 PDT
Events can have a negative timestamp which causes app breakage. This may have been a regression from r222392.

To reproduce:
1. Open https://codepen.io/cdumez/pen/xjEmdX in MobileSafari
2. Tap the red box and notice that the touchstart / touchend event timestamps are positive.
3. Put MobileSafari in the background for ~5 minutes then re-open MobileSafari
4. Tap the red box again and notice that the touchstart / touchend event timestamps are now negative :(
Comment 1 Chris Dumez 2018-04-26 12:42:02 PDT
<rdar://problem/39638051>
Comment 2 Chris Dumez 2018-04-27 09:40:14 PDT
The actual fix is in UIKit when generating the touch's timestamp.

I will use this bug to do some hardening in WebKit to make sure Event.timestamp can never return a negative value.
Comment 3 Chris Dumez 2018-04-27 10:52:50 PDT
Created attachment 339005 [details]
Patch
Comment 4 WebKit Commit Bot 2018-04-27 14:21:35 PDT
Comment on attachment 339005 [details]
Patch

Clearing flags on attachment: 339005

Committed r231111: <https://trac.webkit.org/changeset/231111>
Comment 5 WebKit Commit Bot 2018-04-27 14:21:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Lucas Forschler 2019-02-06 09:18:25 PST
Mass move bugs into the DOM component.