Merge pull request #16401 from Snuffleupagus/Safari-15.4

[api-minor] Update the minimum supported Safari version to 15.4
This commit is contained in:
Tim van der Meij 2023-05-12 10:11:53 +02:00 committed by GitHub
commit a5336d9d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 66 deletions

View File

@ -79,7 +79,7 @@ const ENV_TARGETS = [
"last 2 versions",
"Chrome >= 88",
"Firefox ESR",
"Safari >= 14.1",
"Safari >= 15.4",
"Node >= 18",
"> 1%",
"not IE > 0",
@ -192,8 +192,6 @@ function createWebpackConfig(
DEFAULT_PREFERENCES: defaultPreferencesDir
? getDefaultPreferences(defaultPreferencesDir)
: {},
DIALOG_POLYFILL_CSS:
defines.GENERIC && !defines.SKIP_BABEL ? getDialogPolyfillCSS() : "",
});
const licenseHeaderLibre = fs
.readFileSync("./src/license_header_libre.js")
@ -821,12 +819,6 @@ function getDefaultPreferences(dir) {
return AppOptions.getAll(OptionKind.PREFERENCE);
}
function getDialogPolyfillCSS() {
return fs
.readFileSync("node_modules/dialog-polyfill/dist/dialog-polyfill.css")
.toString();
}
gulp.task("locale", function () {
const VIEWER_LOCALE_OUTPUT = "web/locale/";
@ -1585,8 +1577,6 @@ function buildLib(defines, dir) {
DEFAULT_PREFERENCES: getDefaultPreferences(
defines.SKIP_BABEL ? "lib/" : "lib-legacy/"
),
DIALOG_POLYFILL_CSS:
defines.GENERIC && !defines.SKIP_BABEL ? getDialogPolyfillCSS() : "",
});
const inputStream = merge([

37
package-lock.json generated
View File

@ -20,7 +20,6 @@
"canvas": "^2.11.2",
"core-js": "^3.30.1",
"cross-env": "^7.0.3",
"dialog-polyfill": "^0.5.6",
"es-module-shims": "1.4.7",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
@ -5030,12 +5029,6 @@
"kuler": "1.0.x"
}
},
"node_modules/dialog-polyfill": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz",
"integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==",
"dev": true
},
"node_modules/dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
@ -12506,7 +12499,7 @@
},
"node_modules/npm/node_modules/lodash._baseindexof": {
"version": "3.1.0",
"dev": true,
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
@ -12522,19 +12515,19 @@
},
"node_modules/npm/node_modules/lodash._bindcallback": {
"version": "3.0.1",
"dev": true,
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/npm/node_modules/lodash._cacheindexof": {
"version": "3.0.2",
"dev": true,
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/npm/node_modules/lodash._createcache": {
"version": "3.1.2",
"dev": true,
"extraneous": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
@ -12549,7 +12542,7 @@
},
"node_modules/npm/node_modules/lodash._getnative": {
"version": "3.9.1",
"dev": true,
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
@ -12567,7 +12560,7 @@
},
"node_modules/npm/node_modules/lodash.restparam": {
"version": "3.6.1",
"dev": true,
"extraneous": true,
"inBundle": true,
"license": "MIT"
},
@ -23031,12 +23024,6 @@
"kuler": "1.0.x"
}
},
"dialog-polyfill": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz",
"integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==",
"dev": true
},
"dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
@ -28769,7 +28756,7 @@
"lodash._baseindexof": {
"version": "3.1.0",
"bundled": true,
"dev": true
"extraneous": true
},
"lodash._baseuniq": {
"version": "4.6.0",
@ -28783,17 +28770,17 @@
"lodash._bindcallback": {
"version": "3.0.1",
"bundled": true,
"dev": true
"extraneous": true
},
"lodash._cacheindexof": {
"version": "3.0.2",
"bundled": true,
"dev": true
"extraneous": true
},
"lodash._createcache": {
"version": "3.1.2",
"bundled": true,
"dev": true,
"extraneous": true,
"requires": {
"lodash._getnative": "^3.0.0"
}
@ -28806,7 +28793,7 @@
"lodash._getnative": {
"version": "3.9.1",
"bundled": true,
"dev": true
"extraneous": true
},
"lodash._root": {
"version": "3.0.1",
@ -28821,7 +28808,7 @@
"lodash.restparam": {
"version": "3.6.1",
"bundled": true,
"dev": true
"extraneous": true
},
"lodash.union": {
"version": "4.6.0",

View File

@ -13,7 +13,6 @@
"canvas": "^2.11.2",
"core-js": "^3.30.1",
"cross-env": "^7.0.3",
"dialog-polyfill": "^0.5.6",
"es-module-shims": "1.4.7",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",

View File

@ -36,7 +36,7 @@ import { isNodeJS } from "./is_node.js";
polyfillPath2D(globalThis);
})();
// Support: Chrome<92, Safari<15.4
// Support: Chrome<92
(function checkArrayAt() {
if (Array.prototype.at) {
return;
@ -44,7 +44,7 @@ import { isNodeJS } from "./is_node.js";
require("core-js/es/array/at.js");
})();
// Support: Chrome<92, Safari<15.4
// Support: Chrome<92
(function checkTypedArrayAt() {
if (Uint8Array.prototype.at) {
return;
@ -52,7 +52,7 @@ import { isNodeJS } from "./is_node.js";
require("core-js/es/typed-array/at.js");
})();
// Support: Chrome<98, Safari<15.4
// Support: Chrome<98
(function checkStructuredClone() {
if (globalThis.structuredClone) {
return;

View File

@ -37,24 +37,6 @@ class OverlayManager {
}
this.#overlays.set(dialog, { canForceClose });
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("GENERIC && !SKIP_BABEL") &&
!dialog.showModal
) {
const dialogPolyfill = require("dialog-polyfill/dist/dialog-polyfill.js");
dialogPolyfill.registerDialog(dialog);
if (!this._dialogPolyfillCSS) {
this._dialogPolyfillCSS = true;
const style = document.createElement("style");
style.textContent = PDFJSDev.eval("DIALOG_POLYFILL_CSS");
document.head.prepend(style);
}
}
dialog.addEventListener("cancel", evt => {
this.#active = null;
});

View File

@ -2180,14 +2180,7 @@ class PDFViewer {
for (const entry of entries) {
if (entry.target === this.container) {
this.#updateContainerHeightCss(
// Safari doesn't support `borderBoxSize` until version 15.4.
Math.floor(
typeof PDFJSDev !== "undefined" &&
!PDFJSDev.test("SKIP_BABEL") &&
!entry.borderBoxSize?.length
? entry.contentRect.height
: entry.borderBoxSize[0].blockSize
)
Math.floor(entry.borderBoxSize[0].blockSize)
);
this.#containerTopLeft = null;
break;