From ad11cea33c2346d867d098069842627f7b5d7beb Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 31 Jul 2022 17:40:26 +0200 Subject: [PATCH] [api-minor] Update the minimum supported Safari version The Ink-editor uses `ResizeObserver`, which is supported in all reasonably modern browsers; see https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#browser_compatibility With the exception of Safari, `ResizeObserver` is thus available in all of the browsers that the PDF.js library currently support. Rather than trying to e.g. add a polyfill, let's just bump the compatibility (slightly) to Safari 13.1 instead; see https://en.wikipedia.org/wiki/Safari_version_history#Safari_13 --- gulpfile.js | 2 +- web/app_options.js | 7 ------- web/base_viewer.js | 6 +----- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 936be8376..740de4b7c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -84,7 +84,7 @@ const AUTOPREFIXER_CONFIG = { "last 2 versions", "Chrome >= 76", "Firefox ESR", - "Safari >= 13", + "Safari >= 13.1", "> 1%", "not IE > 0", "not dead", diff --git a/web/app_options.js b/web/app_options.js index 79c75b5e0..a8c5d84ec 100644 --- a/web/app_options.js +++ b/web/app_options.js @@ -38,13 +38,6 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { compatibilityParams.maxCanvasPixels = 5242880; } })(); - - // Support: Safari<13.1 - (function checkResizeObserver() { - if (typeof ResizeObserver === "undefined") { - compatibilityParams.annotationEditorMode = -1; - } - })(); } const OptionKind = { diff --git a/web/base_viewer.js b/web/base_viewer.js index a8faa2d48..6ce993b98 100644 --- a/web/base_viewer.js +++ b/web/base_viewer.js @@ -67,7 +67,6 @@ import { } from "./ui_utils.js"; import { AnnotationEditorLayerBuilder } from "./annotation_editor_layer_builder.js"; import { AnnotationLayerBuilder } from "./annotation_layer_builder.js"; -import { compatibilityParams } from "./app_options.js"; import { NullL10n } from "./l10n_utils.js"; import { PDFPageView } from "./pdf_page_view.js"; import { PDFRenderingQueue } from "./pdf_rendering_queue.js"; @@ -86,9 +85,6 @@ const PagesCountLimit = { PAUSE_EAGER_PAGE_INIT: 250, }; -const ANNOTATION_EDITOR_MODE = - compatibilityParams.annotationEditorMode ?? AnnotationEditorType.DISABLE; - function isValidAnnotationEditorMode(mode) { return ( Object.values(AnnotationEditorType).includes(mode) && @@ -281,7 +277,7 @@ class BaseViewer { this.#annotationMode = options.annotationMode ?? AnnotationMode.ENABLE_FORMS; this.#annotationEditorMode = - options.annotationEditorMode ?? ANNOTATION_EDITOR_MODE; + options.annotationEditorMode ?? AnnotationEditorType.DISABLE; this.imageResourcesPath = options.imageResourcesPath || ""; this.enablePrintAutoRotate = options.enablePrintAutoRotate || false; if (