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) {
|
||||
canvasInRendering.delete(this._canvas);
|
||||
}
|
||||
|
||||
if ((typeof PDFJSDev !== 'undefined' && PDFJSDev.test('PDFJS_NEXT')) ||
|
||||
getDefaultSetting('pdfjsNext')) {
|
||||
this.callback(new RenderingCancelledException(
|
||||
'Rendering cancelled, page ' + this.pageNumber, 'canvas'));
|
||||
} else {
|
||||
this.callback('cancelled');
|
||||
}
|
||||
this.callback(new RenderingCancelledException(
|
||||
'Rendering cancelled, page ' + this.pageNumber, 'canvas'));
|
||||
},
|
||||
|
||||
operatorListChanged: function InternalRenderTask_operatorListChanged() {
|
||||
|
@ -407,9 +407,7 @@ class PDFPageView {
|
||||
this.paintTask = null;
|
||||
}
|
||||
|
||||
if (((typeof PDFJSDev === 'undefined' ||
|
||||
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
|
||||
error instanceof RenderingCancelledException) {
|
||||
if (error instanceof RenderingCancelledException) {
|
||||
this.error = null;
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
@ -589,13 +587,8 @@ class PDFPageView {
|
||||
let cancelled = false;
|
||||
let ensureNotCancelled = () => {
|
||||
if (cancelled) {
|
||||
if ((typeof PDFJSDev !== 'undefined' &&
|
||||
PDFJSDev.test('PDFJS_NEXT')) || PDFJS.pdfjsNext) {
|
||||
throw new RenderingCancelledException(
|
||||
'Rendering cancelled, page ' + this.id, 'svg');
|
||||
} else {
|
||||
throw 'cancelled'; // eslint-disable-line no-throw-literal
|
||||
}
|
||||
throw new RenderingCancelledException(
|
||||
'Rendering cancelled, page ' + this.id, 'svg');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -303,9 +303,7 @@ class PDFThumbnailView {
|
||||
this.renderTask = null;
|
||||
}
|
||||
|
||||
if (((typeof PDFJSDev === 'undefined' ||
|
||||
!PDFJSDev.test('PDFJS_NEXT')) && error === 'cancelled') ||
|
||||
error instanceof RenderingCancelledException) {
|
||||
if (error instanceof RenderingCancelledException) {
|
||||
renderCapability.resolve(undefined);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user