]> source.dussan.org Git - jquery.git/commitdiff
CSS: Stop Firefox from treating disconnected elements as cascade-hidden
authorRichard Gibson <richard.gibson@gmail.com>
Thu, 14 Jan 2016 20:27:17 +0000 (15:27 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Thu, 14 Jan 2016 22:53:39 +0000 (17:53 -0500)
Fixes gh-2833
Ref dba93f79c405373ec3a492fd0a4bf89b3136a6e6
Close gh-2835

src/css/showHide.js

index 9c62d556459d01c4e93874f45f95bf1bae2fbe08..9e2cb1ea4a5dc88a39c0b66368ccc840d98fe53b 100644 (file)
@@ -54,7 +54,12 @@ function showHide( elements, show ) {
                                        elem.style.display = "";
                                }
                        }
-                       if ( elem.style.display === "" && jQuery.css( elem, "display" ) === "none" ) {
+                       if ( elem.style.display === "" && jQuery.css( elem, "display" ) === "none" &&
+
+                                       // Support: Firefox <=42 - 43
+                                       // Don't set inline display on disconnected elements with computed display: none
+                                       jQuery.contains( elem.ownerDocument, elem ) ) {
+
                                values[ index ] = getDefaultDisplay( elem );
                        }
                } else {