From d5174cd826bdf2f1a11aed8123ebeabe97ae7626 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 15 Nov 2017 15:54:08 +0100 Subject: [PATCH] Remove the `requestAnimationFrame` polyfill According to https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame#Browser_compatibility and https://caniuse.com/#feat=requestanimationframe, the browsers we intend to support with PDF.js version 2.0 should all have native `requestAnimationFrame` support. Note that the reason for indiscriminately polyfilling `requestAnimationFrame` in iOS, see PR 4961, was apparently because of a bug in iOS 6. However, according to [Wikipedia](https://en.wikipedia.org/wiki/IOS_version_history#iOS_8): "Support for iOS 8 ended in 2017.", hence the lowest version currently supported is iOS 9. --- src/shared/compatibility.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/shared/compatibility.js b/src/shared/compatibility.js index 4822755cd..f8e70ef4b 100644 --- a/src/shared/compatibility.js +++ b/src/shared/compatibility.js @@ -531,36 +531,6 @@ PDFJS.compatibilityChecked = true; } })(); -// Support: IE<10, Android<4.0, iOS -(function checkRequestAnimationFrame() { - function installFakeAnimationFrameFunctions() { - window.requestAnimationFrame = function (callback) { - return window.setTimeout(callback, 20); - }; - window.cancelAnimationFrame = function (timeoutID) { - window.clearTimeout(timeoutID); - }; - } - - if (!hasDOM) { - return; - } - if (isIOS) { - // requestAnimationFrame on iOS is broken, replacing with fake one. - installFakeAnimationFrameFunctions(); - return; - } - if ('requestAnimationFrame' in window) { - return; - } - window.requestAnimationFrame = window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame; - if (window.requestAnimationFrame) { - return; - } - installFakeAnimationFrameFunctions(); -})(); - // Support: Android, iOS (function checkCanvasSizeLimitation() { if (isIOS || isAndroid) {