From 58f12f430a85c4c9c061178c0098860165cacbf0 Mon Sep 17 00:00:00 2001 From: Majid Valipour Date: Thu, 10 Dec 2015 13:17:30 -0500 Subject: [PATCH] fix: Use Date.now() instead of Event.timeStamp to detect animation end Chrome and Firefox are planning to change event.timeStamp to be a high resolution time instead of epoch time. This means that the event.timeStamp will not longer be compatible with Date.now()[1, 2] Instead we can use Date.now() at the moment when the event is received by event listener instead. [1] http://crbug.com/538600 [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1231619#c3 --- src/ngAnimate/animateCss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngAnimate/animateCss.js b/src/ngAnimate/animateCss.js index 1039db3425df..4dca500d9bb9 100644 --- a/src/ngAnimate/animateCss.js +++ b/src/ngAnimate/animateCss.js @@ -792,7 +792,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) { function onAnimationProgress(event) { event.stopPropagation(); var ev = event.originalEvent || event; - var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now(); + var timeStamp = ev.$manualTimeStamp || Date.now(); /* Firefox (or possibly just Gecko) likes to not round values up * when a ms measurement is used for the animation */