mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Uses rAF to interrupt the operator list execution
This commit is contained in:
parent
abc924b5af
commit
c5eb058b09
4 changed files with 28 additions and 18 deletions
|
@ -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);
|
||||
});
|
||||
})();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue