]> source.dussan.org Git - jquery.git/commitdiff
Support: ensure display is set to block for the support div
authorTimmy Willison <4timmywil@gmail.com>
Wed, 17 Feb 2021 21:19:04 +0000 (16:19 -0500)
committerGitHub <noreply@github.com>
Wed, 17 Feb 2021 21:19:04 +0000 (16:19 -0500)
* Support: ensure display is set to block for the support div

- Fixes an issue with the support test in iframes in Android 8 Chrome 86+,
  where display: inline resulted in unexpected height values.

Close gh-4845
Fixes gh-4832

src/css/support.js

index 9e6a915d2bbb5d55235f4df3a45f1db845c31485..48f95dc3665b72dc5ef3212c7f695bcfab4c6766 100644 (file)
@@ -33,6 +33,15 @@ support.reliableTrDimensions = function() {
                tr.style.height = "1px";
                div.style.height = "9px";
 
+               // Support: Android Chrome 86+
+               // In our bodyBackground.html iframe,
+               // display for all div elements is set to "inline",
+               // which causes a problem only in Android Chrome, but
+               // not consistently across all devices.
+               // Ensuring the div is display: block
+               // gets around this issue.
+               div.style.display = "block";
+
                documentElement
                        .appendChild( table )
                        .appendChild( tr )