diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-04-01 21:13:01 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-04-03 19:13:41 -0400 |
commit | 5fc2281fcc83783b86647a5a86380b9ac21e7f79 (patch) | |
tree | 61cc874de546f40c8905156296db4c2abc7281ff /test | |
parent | 1e9b3ef3d87a0934dec969ed469cd3cc9c910ae8 (diff) | |
download | jquery-5fc2281fcc83783b86647a5a86380b9ac21e7f79.tar.gz jquery-5fc2281fcc83783b86647a5a86380b9ac21e7f79.zip |
- Added a hook to swap display none for width and height in browsers that do not sufficiently support get/setAttribute
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/attributes.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 262f3499e..a73b51fc5 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -75,7 +75,7 @@ test("prop(String, Object)", function() { }); test("attr(String)", function() { - expect(28); + expect(30); equals( jQuery('#text1').attr('type'), "text", 'Check for type attribute' ); equals( jQuery('#radio1').attr('type'), "radio", 'Check for type attribute' ); @@ -125,12 +125,16 @@ test("attr(String)", function() { optgroup.appendChild( option ); select.appendChild( optgroup ); - ok( jQuery("<div/>").attr("doesntexist") === undefined, "Make sure undefined is returned when no attribute is found." ); - ok( jQuery().attr("doesntexist") === undefined, "Make sure undefined is returned when no element is there." ); - + var $img = jQuery('<img style="display:none" width="215" height="53" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif"/>').appendTo('body'); + equals( $img.attr('width'), "215", "Retrieve width attribute an an element with display:none." ); + equals( $img.attr('height'), "53", "Retrieve height attribute an an element with display:none." ); + // Check for style support ok( !!~jQuery('#dl').attr('style').indexOf('absolute'), 'Check style attribute getter' ); ok( !!~jQuery('#foo').attr('style', 'position:absolute;').attr('style').indexOf('absolute'), 'Check style setter' ); + + ok( jQuery("<div/>").attr("doesntexist") === undefined, "Make sure undefined is returned when no attribute is found." ); + ok( jQuery().attr("doesntexist") === undefined, "Make sure undefined is returned when no element is there." ); }); if ( !isLocal ) { |