]> source.dussan.org Git - jquery.git/commitdiff
Landing pull request 530. Fixes coniditional path for tr, td defaultDisplay() calls...
authorRick Waldron <waldron.rick@gmail.com>
Tue, 4 Oct 2011 19:53:19 +0000 (15:53 -0400)
committertimmywil <timmywillisn@gmail.com>
Tue, 4 Oct 2011 19:53:19 +0000 (15:53 -0400)
More Details:
 - https://github.com/jquery/jquery/pull/530
 - http://bugs.jquery.com/ticket/10416

src/effects.js
test/unit/effects.js

index e14235bc41e0ea7330ccdbca8a6367fadb721eb7..67ac8bb41c81d6f7b9f572999316bffe74305c3c 100644 (file)
@@ -38,7 +38,7 @@ jQuery.fn.extend({
                                        // Set elements which have been overridden with display: none
                                        // in a stylesheet to whatever the default browser style is
                                        // for such an element
-                                       if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
+                                       if ( display === "none" || ( display === ""  && jQuery.css( elem, "display" ) === "none" ) ) {
                                                jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
                                        }
                                }
index 24f1b53f9734b589e69ee32a7b51ad948059989f..2492ea08cc16dbc09e4639bc9363f3d630de6ebf 100644 (file)
@@ -188,6 +188,21 @@ test("show() resolves correct default display #8099", function() {
 
 });
 
+test("defaultDisplay() correctly determines tr, td display #10416", function() {
+
+       expect( 1 );
+       var tr = "<tr></tr>",
+                       td = "<td>new</td>";
+
+       jQuery( tr ).append( td ).appendTo( "#table" );
+       jQuery( tr ).hide().append( td ).appendTo( "#table" ).show();
+
+       equal(
+               jQuery( "#table" ).find( "tr" ).eq( 1 ).css( "display" ),
+               jQuery( "#table" ).find( "tr" ).eq( 0 ).css( "display" ),
+               "defaultDisplay() returns correct tr display values"
+       );
+});
 
 test("animate(Hash, Object, Function)", function() {
        expect(1);