[GeckoView] Ignore Scroll/Spread-modes in the PDFViewer setters

Rather than sprinkling pre-processor statements throughout the viewer-code, simply "disable" the relevant `PDFViewer` setters instead.

Also, given that the GeckoView-specific viewer doesn't have a sidebar we don't actually need to explicitly ignore a `pageMode` during loading.
This commit is contained in:
Jonas Jenwald 2023-06-20 12:32:58 +02:00
parent 03059e1f86
commit cca299eeb9
3 changed files with 32 additions and 30 deletions

View file

@ -1842,6 +1842,15 @@ class PDFViewer {
* The constants from {ScrollMode} should be used.
*/
set scrollMode(mode) {
if (
typeof PDFJSDev === "undefined"
? window.isGECKOVIEW
: PDFJSDev.test("GECKOVIEW")
) {
// NOTE: Always ignore the pageLayout in GeckoView since there's
// no UI available to change Scroll/Spread modes for the user.
return;
}
if (this._scrollMode === mode) {
return; // The Scroll mode didn't change.
}
@ -1903,6 +1912,15 @@ class PDFViewer {
* The constants from {SpreadMode} should be used.
*/
set spreadMode(mode) {
if (
typeof PDFJSDev === "undefined"
? window.isGECKOVIEW
: PDFJSDev.test("GECKOVIEW")
) {
// NOTE: Always ignore the pageLayout in GeckoView since there's
// no UI available to change Scroll/Spread modes for the user.
return;
}
if (this._spreadMode === mode) {
return; // The Spread mode didn't change.
}