Uses rAF to interrupt the operator list execution

This commit is contained in:
Yury Delendik 2014-05-09 07:00:47 -05:00
parent abc924b5af
commit c5eb058b09
4 changed files with 28 additions and 18 deletions

View file

@ -2410,16 +2410,8 @@ window.addEventListener('afterprint', function afterPrint(evt) {
(function animationStartedClosure() {
// The offsetParent is not set until the pdf.js iframe or object is visible.
// Waiting for first animation.
var requestAnimationFrame = window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function startAtOnce(callback) { callback(); };
PDFView.animationStartedPromise = new Promise(function (resolve) {
requestAnimationFrame(function onAnimationFrame() {
resolve();
});
window.requestAnimationFrame(resolve);
});
})();