Skip to content

Commit e5256a6

Browse files
committed
Revert "Effects: Reintroduce use of requestAnimationFrame"
This reverts commit 06a4540.
1 parent a769a01 commit e5256a6

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/effects.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ var
2222
rfxtypes = /^(?:toggle|show|hide)$/,
2323
rrun = /queueHooks$/;
2424

25-
function raf() {
26-
if ( timerId ) {
27-
window.requestAnimationFrame( raf );
28-
jQuery.fx.tick();
29-
}
30-
}
31-
32-
// Will get false negative for old browsers which is okay
33-
function isDocumentHidden() {
34-
return "hidden" in document && document.hidden;
35-
}
36-
3725
// Animations created synchronously will run synchronously
3826
function createFxNow() {
3927
window.setTimeout( function() {
@@ -447,10 +435,6 @@ jQuery.fn.extend( {
447435
.end().animate( { opacity: to }, speed, easing, callback );
448436
},
449437
animate: function( prop, speed, easing, callback ) {
450-
if ( isDocumentHidden() ) {
451-
return this;
452-
}
453-
454438
var empty = jQuery.isEmptyObject( prop ),
455439
optall = jQuery.speed( speed, easing, callback ),
456440
doAnimation = function() {
@@ -623,12 +607,7 @@ jQuery.fx.interval = 13;
623607

624608
jQuery.fx.start = function() {
625609
if ( !timerId ) {
626-
if ( window.requestAnimationFrame ) {
627-
timerId = true;
628-
window.requestAnimationFrame( raf );
629-
} else {
630-
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
631-
}
610+
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
632611
}
633612
};
634613

test/unit/effects.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ if ( !jQuery.fx ) {
55
return;
66
}
77

8-
var oldRaf = window.requestAnimationFrame;
9-
108
module("effects", {
119
setup: function() {
12-
window.requestAnimationFrame = null;
1310
this.clock = sinon.useFakeTimers( 505877050 );
1411
this._oldInterval = jQuery.fx.interval;
1512
jQuery.fx.interval = 10;
@@ -18,7 +15,6 @@ module("effects", {
1815
this.clock.restore();
1916
jQuery.fx.stop();
2017
jQuery.fx.interval = this._oldInterval;
21-
window.requestAnimationFrame = oldRaf;
2218
return moduleTeardown.apply( this, arguments );
2319
}
2420
});

0 commit comments

Comments
 (0)