diff options
author | Colin Snover <github.com@zetafleet.com> | 2010-10-05 13:23:10 -0500 |
---|---|---|
committer | Colin Snover <github.com@zetafleet.com> | 2010-10-05 13:23:10 -0500 |
commit | 0229b83f7e5bf64edb2888ab349bedcd1a45e7c1 (patch) | |
tree | b64ed6838516be56965ddf9b0bbf9deb2437772a /test | |
parent | 57c046f91cbc3caf174ecc993fe883c027340901 (diff) | |
download | jquery-0229b83f7e5bf64edb2888ab349bedcd1a45e7c1.tar.gz jquery-0229b83f7e5bf64edb2888ab349bedcd1a45e7c1.zip |
Fix :visible does not work properly when display:none is set directly on an element in IE8. Fixes #4512.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/css.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index 468f76386..cfffb7832 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -256,3 +256,16 @@ test("jQuery.css(elem, 'height') doesn't clear radio buttons (bug #1095)", funct ok( !! jQuery(":checkbox:first", $checkedtest).attr("checked"), "Check first checkbox still checked." ); ok( ! jQuery(":checkbox:last", $checkedtest).attr("checked"), "Check last checkbox still NOT checked." ); }); + +test(":visible selector works properly on table elements (bug #4512)", function () { + expect(1); + + jQuery('#table').html('<tr><td style="display:none">cell</td><td>cell</td></tr>'); + equals(jQuery('#table td:visible').length, 1, "hidden cell is not perceived as visible"); +}); + +test(":visible selector works properly on children with a hidden parent (bug #4512)", function () { + expect(1); + jQuery('#table').css('display', 'none').html('<tr><td>cell</td><td>cell</td></tr>'); + equals(jQuery('#table td:visible').length, 0, "hidden cell children not perceived as visible"); +});
\ No newline at end of file |