Disables broken rAF on iOS
This commit is contained in:
parent
ea16723448
commit
dccc709b50
@ -495,17 +495,25 @@ if (typeof PDFJS === 'undefined') {
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Support: IE<10, Android<4.0, iOS<5.0
|
// Support: IE<10, Android<4.0, iOS
|
||||||
(function checkRequestAnimationFrame() {
|
(function checkRequestAnimationFrame() {
|
||||||
|
function fakeRequestAnimationFrame(callback) {
|
||||||
|
window.setTimeout(callback, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent);
|
||||||
|
if (isIOS) {
|
||||||
|
// requestAnimationFrame on iOS is broken, replacing with fake one.
|
||||||
|
window.requestAnimationFrame = fakeRequestAnimationFrame;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ('requestAnimationFrame' in window) {
|
if ('requestAnimationFrame' in window) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.requestAnimationFrame =
|
window.requestAnimationFrame =
|
||||||
window.mozRequestAnimationFrame ||
|
window.mozRequestAnimationFrame ||
|
||||||
window.webkitRequestAnimationFrame ||
|
window.webkitRequestAnimationFrame ||
|
||||||
(function fakeRequestAnimationFrame(callback) {
|
fakeRequestAnimationFrame;
|
||||||
window.setTimeout(callback, 20);
|
|
||||||
});
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(function checkCanvasSizeLimitation() {
|
(function checkCanvasSizeLimitation() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user