[Pkg-javascript-commits] [pdf.js] 110/207: Disables broken rAF on iOS
David Prévot
taffit at moszumanska.debian.org
Mon Jul 28 15:36:37 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit dccc709b500571960f24e83fd36005fe4cc512f5
Author: Yury Delendik <ydelendik at mozilla.com>
Date: Tue Jun 17 12:44:52 2014 -0500
Disables broken rAF on iOS
---
web/compatibility.js | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/web/compatibility.js b/web/compatibility.js
index b603971..400a940 100644
--- a/web/compatibility.js
+++ b/web/compatibility.js
@@ -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 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) {
return;
}
window.requestAnimationFrame =
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
- (function fakeRequestAnimationFrame(callback) {
- window.setTimeout(callback, 20);
- });
+ fakeRequestAnimationFrame;
})();
(function checkCanvasSizeLimitation() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list