Skip to content

Commit 4462a2c

Browse files
authored
Reduce requestAnimationFrame polyfill (#7033)
* Reduce requestAnimationFrame polyfill * Remove another unnecessary polyfill
1 parent dac52d1 commit 4462a2c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/helpers/index.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,14 @@ export default {
101101

102102
return niceFraction * Math.pow(10, exponent);
103103
},
104-
// Request animation polyfill - https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
104+
// Request animation polyfill
105105
requestAnimFrame: (function() {
106106
if (typeof window === 'undefined') {
107107
return function(callback) {
108108
callback();
109109
};
110110
}
111-
return window.requestAnimationFrame ||
112-
window.webkitRequestAnimationFrame ||
113-
window.mozRequestAnimationFrame ||
114-
window.oRequestAnimationFrame ||
115-
window.msRequestAnimationFrame ||
116-
function(callback) {
117-
return window.setTimeout(callback, 1000 / 60);
118-
};
111+
return window.requestAnimationFrame;
119112
}()),
120113
// -- Canvas methods
121114
fontString: function(pixelSize, fontStyle, fontFamily) {

0 commit comments

Comments
 (0)