Skip to content
Permalink
Browse files

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
Closes #13495
  • Loading branch information
matsko authored and petebacondarwin committed Dec 10, 2015
1 parent b2b896f commit e020b8993ec7b8e004c136ca40ea9bab02207dbf
Showing with 4 additions and 1 deletion.
  1. +4 −1 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 */

0 comments on commit e020b89

Please sign in to comment.
You can’t perform that action at this time.