From b1e66a5faaf46ffcbcc27c79a9a224aaf851a987 Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Tue, 7 Nov 2023 00:35:52 +0100 Subject: CSS: Fix reliableTrDimensions support test for initially hidden iframes Closes gh-5358 Ref gh-5317 Ref gh-5359 --- src/css/support.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/css/support.js b/src/css/support.js index 5f9b37d7f..c7229e93a 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -47,6 +47,12 @@ support.reliableTrDimensions = function() { .appendChild( tr ) .appendChild( div ); + // Don't run until window is visible + if ( table.offsetWidth === 0 ) { + documentElement.removeChild( table ); + return; + } + trStyle = window.getComputedStyle( tr ); reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + parseInt( trStyle.borderTopWidth, 10 ) + -- cgit v1.2.3