Merge pull request #6004 from yurydelendik/print-raf

Bug 1163404 - Disables rAF for the printing.
This commit is contained in:
Brendan Dahl 2015-05-12 10:54:31 -07:00
commit d87c1ecc2b

View File

@ -740,6 +740,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
this.commonObjs,
intentState.operatorList,
this.pageNumber);
internalRenderTask.useRequestAnimationFrame = renderingIntent !== 'print';
if (!intentState.renderTasks) {
intentState.renderTasks = [];
}
@ -1555,6 +1556,7 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
this.running = false;
this.graphicsReadyCallback = null;
this.graphicsReady = false;
this.useRequestAnimationFrame = false;
this.cancelled = false;
this.capability = createPromiseCapability();
this.task = new RenderTask(this);
@ -1628,7 +1630,11 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
},
_scheduleNext: function InternalRenderTask__scheduleNext() {
window.requestAnimationFrame(this._nextBound);
if (this.useRequestAnimationFrame) {
window.requestAnimationFrame(this._nextBound);
} else {
Promise.resolve(undefined).then(this._nextBound);
}
},
_next: function InternalRenderTask__next() {