File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,13 +25,26 @@ var Common = require('./Common');
2525
2626 if ( typeof window !== 'undefined' ) {
2727 _requestAnimationFrame = window . requestAnimationFrame || window . webkitRequestAnimationFrame
28- || window . mozRequestAnimationFrame || window . msRequestAnimationFrame
29- || function ( callback ) { window . setTimeout ( function ( ) { callback ( Common . now ( ) ) ; } , 1000 / 60 ) ; } ;
28+ || window . mozRequestAnimationFrame || window . msRequestAnimationFrame ;
3029
3130 _cancelAnimationFrame = window . cancelAnimationFrame || window . mozCancelAnimationFrame
3231 || window . webkitCancelAnimationFrame || window . msCancelAnimationFrame ;
3332 }
3433
34+ if ( ! _requestAnimationFrame ) {
35+ var _frameTimeout ;
36+
37+ _requestAnimationFrame = function ( callback ) {
38+ _frameTimeout = setTimeout ( function ( ) {
39+ callback ( Common . now ( ) ) ;
40+ } , 1000 / 60 ) ;
41+ } ;
42+
43+ _cancelAnimationFrame = function ( ) {
44+ clearTimeout ( _frameTimeout ) ;
45+ } ;
46+ }
47+
3548 /**
3649 * Creates a new Runner. The options parameter is an object that specifies any properties you wish to override the defaults.
3750 * @method create
You can’t perform that action at this time.
0 commit comments