From be775143b21f2f086dd0241ae11eb0c77bf30741 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 30 Jun 2023 18:32:54 +0200 Subject: [PATCH] [api-minor] Remove the `CSS.supports` checks for the `pageColors`-option in the GENERIC viewer Given the browsers that we currently support it's probably not necessary to keep the checks for the color-values. --- web/pdf_thumbnail_viewer.js | 17 ----------------- web/pdf_viewer.js | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/web/pdf_thumbnail_viewer.js b/web/pdf_thumbnail_viewer.js index 92be8bbe6..c5fc4395c 100644 --- a/web/pdf_thumbnail_viewer.js +++ b/web/pdf_thumbnail_viewer.js @@ -67,23 +67,6 @@ class PDFThumbnailViewer { this.l10n = l10n; this.pageColors = pageColors || null; - if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) { - if ( - this.pageColors && - !( - CSS.supports("color", this.pageColors.background) && - CSS.supports("color", this.pageColors.foreground) - ) - ) { - if (this.pageColors.background || this.pageColors.foreground) { - console.warn( - "PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used." - ); - } - this.pageColors = null; - } - } - this.scroll = watchScroll(this.container, this._scrollUpdated.bind(this)); this._resetView(); } diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index b208d79c6..d417833ee 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -283,23 +283,6 @@ class PDFViewer { this.#enablePermissions = options.enablePermissions || false; this.pageColors = options.pageColors || null; - if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) { - if ( - this.pageColors && - !( - CSS.supports("color", this.pageColors.background) && - CSS.supports("color", this.pageColors.foreground) - ) - ) { - if (this.pageColors.background || this.pageColors.foreground) { - console.warn( - "PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used." - ); - } - this.pageColors = null; - } - } - this.defaultRenderingQueue = !options.renderingQueue; if ( (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&