Skip to content

Commit 2053d1c

Browse files
committed
Remove requestAnimationFrame support. Fixes #9381.
1 parent 0b8b636 commit 2053d1c

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/effects.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ var elemdisplay = {},
1313
// opacity animations
1414
[ "opacity" ]
1515
],
16-
fxNow,
17-
requestAnimationFrame = window.webkitRequestAnimationFrame ||
18-
window.mozRequestAnimationFrame ||
19-
window.oRequestAnimationFrame;
16+
fxNow;
2017

2118
jQuery.fn.extend({
2219
show: function( speed, easing, callback ) {
@@ -392,8 +389,7 @@ jQuery.fx.prototype = {
392389
// Start an animation from one number to another
393390
custom: function( from, to, unit ) {
394391
var self = this,
395-
fx = jQuery.fx,
396-
raf;
392+
fx = jQuery.fx;
397393

398394
this.startTime = fxNow || createFxNow();
399395
this.start = from;
@@ -409,20 +405,7 @@ jQuery.fx.prototype = {
409405
t.elem = this.elem;
410406

411407
if ( t() && jQuery.timers.push(t) && !timerId ) {
412-
// Use requestAnimationFrame instead of setInterval if available
413-
if ( requestAnimationFrame ) {
414-
timerId = true;
415-
raf = function() {
416-
// When timerId gets set to null at any point, this stops
417-
if ( timerId ) {
418-
requestAnimationFrame( raf );
419-
fx.tick();
420-
}
421-
};
422-
requestAnimationFrame( raf );
423-
} else {
424-
timerId = setInterval( fx.tick, fx.interval );
425-
}
408+
timerId = setInterval( fx.tick, fx.interval );
426409
}
427410
},
428411

0 commit comments

Comments
 (0)