diff options
author | Brandon Aaron <brandon.aaron@gmail.com> | 2009-03-18 17:55:07 +0000 |
---|---|---|
committer | Brandon Aaron <brandon.aaron@gmail.com> | 2009-03-18 17:55:07 +0000 |
commit | 2c31a1624f72df3987cd1d0d3605c359658986e5 (patch) | |
tree | c2695b21c2ad995f5b3693a4d2ed152682250362 /test/unit/selector.js | |
parent | 62a251a0cf8b8652082da3d5a72b6c6e2b120914 (diff) | |
download | jquery-2c31a1624f72df3987cd1d0d3605c359658986e5.tar.gz jquery-2c31a1624f72df3987cd1d0d3605c359658986e5.zip |
fix for #4374, gap in :hidden, :visible logic
Diffstat (limited to 'test/unit/selector.js')
-rw-r--r-- | test/unit/selector.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js index 42624f213..708204b6e 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -311,7 +311,7 @@ test("attributes", function() { }); test("pseudo (:) selectors", function() { - expect(70); + expect(78); t( "First Child", "p:first-child", ["firstp","sndp"] ); t( "Last Child", "p:last-child", ["sap"] ); t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2","liveLink1","liveLink2"] ); @@ -362,6 +362,21 @@ test("pseudo (:) selectors", function() { t( "Is Hidden", "#form input:hidden", ["text1","text2","radio1","radio2","check1","check2","hidden1","hidden2","name","search"] ); t( "Is Hidden", "#main:hidden", ["main"] ); t( "Is Hidden", "#dl:hidden", ["dl"] ); + + var $div = jQuery('#nothiddendivchild'); + $div.width(0).height(0); + t( "Is Hidden", '#nothiddendivchild:hidden', ['nothiddendivchild'] ); + t( "Is Not Hidden", '#nothiddendivchild:visible', [] ); + $div.width(1).height(0); + t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); + t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); + $div.width(0).height(1); + t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); + t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); + $div.width(1).height(1); + t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] ); + t( "Is Not Visible", '#nothiddendivchild:hidden', [] ); + $div.width('').height(''); t( "Check position filtering", "div#nothiddendiv:eq(0)", ["nothiddendiv"] ); t( "Check position filtering", "div#nothiddendiv:last", ["nothiddendiv"] ); |