Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 620a20d

Browse files
matskopetebacondarwin
authored andcommitted
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
1 parent 1f8431b commit 620a20d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ngAnimate/animateCss.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,10 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
792792
function onAnimationProgress(event) {
793793
event.stopPropagation();
794794
var ev = event.originalEvent || event;
795-
var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now();
795+
796+
// we now always use `Date.now()` due to the recent changes with
797+
// event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info)
798+
var timeStamp = ev.$manualTimeStamp || Date.now();
796799

797800
/* Firefox (or possibly just Gecko) likes to not round values up
798801
* when a ms measurement is used for the animation */

0 commit comments

Comments
 (0)