1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

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

@ -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;