{"aliases":["default","caniuse:requestanimationframe","modernizr:requestanimationframe"],"browsers":{"bb":"7","chrome":"1 - 23","ie":"6 - 9","ios_saf":"3.2 - 6","firefox":"3.6 - 22","opera":"9 - 12.1","op_mini":"5 - 7","op_mob":"10 - 12.1","safari":"3.1 - 6","firefox_mob":"3.6"},"dependencies":["Date.now","performance.now"],"license":"MIT","docs":"https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame","baseDir":"requestAnimationFrame","hasTests":true,"rawSource":"\n// requestAnimationFrame\n(function (global) {\n\n\tif ('mozRequestAnimationFrame' in global) {\n\t\tglobal.requestAnimationFrame = function (callback) {\n\t\t    return mozRequestAnimationFrame(function () {\n\t\t        callback(performance.now());\n\t\t    });\n\t\t};\n\t\tglobal.cancelAnimationFrame = mozCancelAnimationFrame;\n\n\t} else if ('webkitRequestAnimationFrame' in global) {\n\t\tglobal.requestAnimationFrame = function (callback) {\n\t\t    return webkitRequestAnimationFrame(function () {\n\t\t        callback(performance.now());\n\t\t    });\n\t\t};\n\t\tglobal.cancelAnimationFrame = webkitCancelAnimationFrame;\n\n\t} else {\n\n\t\tvar lastTime = Date.now();\n\n\t\tglobal.requestAnimationFrame = function (callback) {\n\t\t\tif (typeof callback !== 'function') {\n\t\t\t\tthrow new TypeError(callback + 'is not a function');\n\t\t\t}\n\n\t\t\tvar\n\t\t\tcurrentTime = Date.now(),\n\t\t\tdelay = 16 + lastTime - currentTime;\n\n\t\t\tif (delay < 0) {\n\t\t\t\tdelay = 0;\n\t\t\t}\n\n\t\t\tlastTime = currentTime;\n\n\t\t\treturn setTimeout(function () {\n\t\t\t\tlastTime = Date.now();\n\n\t\t\t\tcallback(performance.now());\n\t\t\t}, delay);\n\t\t};\n\n\t\tglobal.cancelAnimationFrame = function (id) {\n\t\t\tclearTimeout(id);\n\t\t};\n\t}\n})(this);\n","minSource":"!function(n){if(\"mozRequestAnimationFrame\"in n)n.requestAnimationFrame=function(n){return mozRequestAnimationFrame(function(){n(performance.now())})},n.cancelAnimationFrame=mozCancelAnimationFrame;else if(\"webkitRequestAnimationFrame\"in n)n.requestAnimationFrame=function(n){return webkitRequestAnimationFrame(function(){n(performance.now())})},n.cancelAnimationFrame=webkitCancelAnimationFrame;else{var e=Date.now();n.requestAnimationFrame=function(n){if(\"function\"!=typeof n)throw new TypeError(n+\"is not a function\");var i=Date.now(),t=16+e-i;return 0>t&&(t=0),e=i,setTimeout(function(){e=Date.now(),n(performance.now())},t)},n.cancelAnimationFrame=function(n){clearTimeout(n)}}}(this);","detectSource":"'requestAnimationFrame' in this"}