mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #9138 from Snuffleupagus/rm-requestAnimationFrame-polyfill
Remove the `requestAnimationFrame` polyfill
This commit is contained in:
commit
e162df59bb
1 changed files with 0 additions and 30 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue