Merge pull request #16311 from linxianxi/fix-viewer-browser-compatibility
Compatible with ResizeObserver borderBoxSize in legacy safari
This commit is contained in:
commit
88e2d04b90
@ -2169,7 +2169,14 @@ class PDFViewer {
|
|||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
if (entry.target === this.container) {
|
if (entry.target === this.container) {
|
||||||
this.#updateContainerHeightCss(
|
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;
|
this.#containerTopLeft = null;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user