Compatible with ResizeObserver borderBoxSize in legacy safari
See https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/borderBoxSize\#browser_compatibility
This commit is contained in:
		
							parent
							
								
									f1b005d7b8
								
							
						
					
					
						commit
						6ca702d680
					
				| @ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user