From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 31 Jan 2020 00:21:30 +0000 (-0800) Subject: Reduce requestAnimationFrame polyfill (#7033) X-Git-Tag: v3.0.0-alpha~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4462a2c950b989aabf6d5c50b20b6b79a9e6a2ba;p=thirdparty%2FChart.js.git Reduce requestAnimationFrame polyfill (#7033) * Reduce requestAnimationFrame polyfill * Remove another unnecessary polyfill --- 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) {