mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #16311 from linxianxi/fix-viewer-browser-compatibility
Compatible with ResizeObserver borderBoxSize in legacy safari
This commit is contained in:
commit
88e2d04b90
1 changed files with 8 additions and 1 deletions
|
@ -2169,7 +2169,14 @@ class PDFViewer {
|
|||
for (const entry of entries) {
|
||||
if (entry.target === this.container) {
|
||||
this.#updateContainerHeightCss(
|
||||
Math.floor(entry.borderBoxSize[0].blockSize)
|
||||
// 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
|
||||
)
|
||||
);
|
||||
this.#containerTopLeft = null;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue