From 4462a2c950b989aabf6d5c50b20b6b79a9e6a2ba Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Thu, 30 Jan 2020 16:21:30 -0800 Subject: [PATCH] Reduce requestAnimationFrame polyfill (#7033) * Reduce requestAnimationFrame polyfill * Remove another unnecessary polyfill --- src/helpers/index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/helpers/index.js b/src/helpers/index.js index 24eefc906..df5d4fbd0 100644 --- a/src/helpers/index.js +++ b/src/helpers/index.js @@ -101,21 +101,14 @@ export default { return niceFraction * Math.pow(10, exponent); }, - // Request animation polyfill - https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/ + // Request animation polyfill requestAnimFrame: (function() { if (typeof window === 'undefined') { return function(callback) { callback(); }; } - return window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(callback) { - return window.setTimeout(callback, 1000 / 60); - }; + return window.requestAnimationFrame; }()), // -- Canvas methods fontString: function(pixelSize, fontStyle, fontFamily) { -- 2.47.2