From 756dd59d46be2dc0deb4267d9b32dd1d2ece0453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matias=20Niemel=C3=A4?= Date: Thu, 10 Dec 2015 11:39:53 -0800 Subject: [PATCH] fix(ngAnimate): do not use event.timeStamp anymore for time tracking Due to recent changes in Chrome, Firefox and Webkit use of the event.timeStamp value will lead to unpredictable behaviour due to precision changes. Therefore it's best to stick entirely to use `Date.now()` when it comes to confirming the end of transition- ending values. See #13494 for more info. Applies to 1.2, 1.3, 1.4 and 1.5. Closes #13494 --- src/ngAnimate/animateCss.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ngAnimate/animateCss.js b/src/ngAnimate/animateCss.js index 1039db3425df..496cf00141b7 100644 --- a/src/ngAnimate/animateCss.js +++ b/src/ngAnimate/animateCss.js @@ -792,7 +792,10 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) { function onAnimationProgress(event) { event.stopPropagation(); var ev = event.originalEvent || event; - var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now(); + + // we now always use `Date.now()` due to the recent changes with + // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info) + 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 */