From: Oleg Gaidarenko Date: Tue, 22 Dec 2015 15:05:42 +0000 (+0300) Subject: Revert "Effects: Reintroduce use of requestAnimationFrame" X-Git-Tag: 1.12.0~38 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e5256a65788ec9ee9cedfd07af7b77148df69dd6;p=jquery.git Revert "Effects: Reintroduce use of requestAnimationFrame" This reverts commit 06a45406966ee8cde31c4f128d7ee68d727880c1. --- diff --git a/src/effects.js b/src/effects.js index 87dedc430..caaa7df64 100644 --- a/src/effects.js +++ b/src/effects.js @@ -22,18 +22,6 @@ var rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; -function raf() { - if ( timerId ) { - window.requestAnimationFrame( raf ); - jQuery.fx.tick(); - } -} - -// Will get false negative for old browsers which is okay -function isDocumentHidden() { - return "hidden" in document && document.hidden; -} - // Animations created synchronously will run synchronously function createFxNow() { window.setTimeout( function() { @@ -447,10 +435,6 @@ jQuery.fn.extend( { .end().animate( { opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { - if ( isDocumentHidden() ) { - return this; - } - var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { @@ -623,12 +607,7 @@ jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { - if ( window.requestAnimationFrame ) { - timerId = true; - window.requestAnimationFrame( raf ); - } else { - timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); - } + timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; diff --git a/test/unit/effects.js b/test/unit/effects.js index 2e65a62ed..03191236a 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -5,11 +5,8 @@ if ( !jQuery.fx ) { return; } -var oldRaf = window.requestAnimationFrame; - module("effects", { setup: function() { - window.requestAnimationFrame = null; this.clock = sinon.useFakeTimers( 505877050 ); this._oldInterval = jQuery.fx.interval; jQuery.fx.interval = 10; @@ -18,7 +15,6 @@ module("effects", { this.clock.restore(); jQuery.fx.stop(); jQuery.fx.interval = this._oldInterval; - window.requestAnimationFrame = oldRaf; return moduleTeardown.apply( this, arguments ); } });