]> source.dussan.org Git - jquery.git/commitdiff
Revert "Effects: Reintroduce use of requestAnimationFrame"
authorOleg Gaidarenko <markelog@gmail.com>
Tue, 22 Dec 2015 15:05:42 +0000 (18:05 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Tue, 22 Dec 2015 15:05:42 +0000 (18:05 +0300)
This reverts commit 06a45406966ee8cde31c4f128d7ee68d727880c1.

src/effects.js
test/unit/effects.js

index 87dedc430464427a4ab991a2ded9137592b64dc4..caaa7df64f143446c02e2ea6ccfb3064f000fa0d 100644 (file)
@@ -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 );
        }
 };
 
index 2e65a62ed55ef5814ff1862b28bc99e8edb2d2d7..03191236a405c307a2a05b1a57c4e98240d6dc3f 100644 (file)
@@ -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 );
        }
 });