Merge pull request #16495 from Snuffleupagus/PDFRenderingQueue-components

Limit some `PDFRenderingQueue`-related code to the GENERIC viewer
This commit is contained in:
Tim van der Meij 2023-06-03 12:33:18 +02:00 committed by GitHub
commit bb5d38acc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -36,6 +36,12 @@ class PDFRenderingQueue {
this.idleTimeout = null;
this.printing = false;
this.isThumbnailViewEnabled = false;
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
Object.defineProperty(this, "hasViewer", {
value: () => !!this.pdfViewer,
});
}
}
/**
@ -60,13 +66,6 @@ class PDFRenderingQueue {
return this.highestPriorityPage === view.renderingId;
}
/**
* @returns {boolean}
*/
hasViewer() {
return !!this.pdfViewer;
}
/**
* @param {Object} currentlyVisiblePages
*/

View File

@ -301,7 +301,10 @@ class PDFViewer {
}
this.defaultRenderingQueue = !options.renderingQueue;
if (this.defaultRenderingQueue) {
if (
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
this.defaultRenderingQueue
) {
// Custom rendering queue is not specified, using default one
this.renderingQueue = new PDFRenderingQueue();
this.renderingQueue.setViewer(this);