Merge pull request #8992 from Snuffleupagus/RenderingCancelledException-API-2
[api-major] When rendering is cancelled, always reject with `RenderingCancelledException`
This commit is contained in:
commit
b9662e97d2
@ -2260,14 +2260,8 @@ var InternalRenderTask = (function InternalRenderTaskClosure() {
|
|||||||
if (this._canvas) {
|
if (this._canvas) {
|
||||||
canvasInRendering.delete(this._canvas);
|
canvasInRendering.delete(this._canvas);
|
||||||
}
|
}
|
||||||
|
this.callback(new RenderingCancelledException(
|
||||||
if ((typeof PDFJSDev !== 'undefined' && PDFJSDev.test('PDFJS_NEXT')) ||
|
'Rendering cancelled, page ' + this.pageNumber, 'canvas'));
|
||||||
getDefaultSetting('pdfjsNext')) {
|
|
||||||
this.callback(new RenderingCancelledException(
|
|
||||||
'Rendering cancelled, page ' + this.pageNumber, 'canvas'));
|
|
||||||
} else {
|
|
||||||
this.callback('cancelled');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
operatorListChanged: function InternalRenderTask_operatorListChanged() {
|
operatorListChanged: function InternalRenderTask_operatorListChanged() {
|
||||||
|
@ -407,9 +407,7 @@ class PDFPageView {
|
|||||||
this.paintTask = null;
|
this.paintTask = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((typeof PDFJSDev === 'undefined' ||
|
if (error instanceof RenderingCancelledException) {
|
||||||
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
|
|
||||||
error instanceof RenderingCancelledException) {
|
|
||||||
this.error = null;
|
this.error = null;
|
||||||
return Promise.resolve(undefined);
|
return Promise.resolve(undefined);
|
||||||
}
|
}
|
||||||
@ -589,13 +587,8 @@ class PDFPageView {
|
|||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
let ensureNotCancelled = () => {
|
let ensureNotCancelled = () => {
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
if ((typeof PDFJSDev !== 'undefined' &&
|
throw new RenderingCancelledException(
|
||||||
PDFJSDev.test('PDFJS_NEXT')) || PDFJS.pdfjsNext) {
|
'Rendering cancelled, page ' + this.id, 'svg');
|
||||||
throw new RenderingCancelledException(
|
|
||||||
'Rendering cancelled, page ' + this.id, 'svg');
|
|
||||||
} else {
|
|
||||||
throw 'cancelled'; // eslint-disable-line no-throw-literal
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -303,9 +303,7 @@ class PDFThumbnailView {
|
|||||||
this.renderTask = null;
|
this.renderTask = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((typeof PDFJSDev === 'undefined' ||
|
if (error instanceof RenderingCancelledException) {
|
||||||
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
|
|
||||||
error instanceof RenderingCancelledException) {
|
|
||||||
renderCapability.resolve(undefined);
|
renderCapability.resolve(undefined);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user