X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=test%2Funit%2Fcss.js;h=8f24e2e347cb852fd8767cb3072ace1ba2fa3062;hb=8b129ccd49365582c4013fd391f6f83cc75a5d0a;hp=632464bcd44b4f483f6226bc2d0c3c1e7e3075e0;hpb=22ccbf82c8badd1d46f5ea52a0a7d5f3935a9fca;p=jquery.git
diff --git a/test/unit/css.js b/test/unit/css.js
index 632464b..8f24e2e 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -1,7 +1,7 @@
module("css");
test("css(String|Hash)", function() {
- expect(34);
+ expect(42);
equals( jQuery('#main').css("display"), 'block', 'Check for css property "display"');
@@ -11,6 +11,26 @@ test("css(String|Hash)", function() {
jQuery('#nothiddendiv').css({display: 'block'});
ok( jQuery('#nothiddendiv').is(':visible'), 'Modified CSS display: Assert element is visible');
+ var div = jQuery( "
" );
+
+ equals( div.css("width"), "0px", "Width on disconnected node." );
+ equals( div.css("height"), "0px", "Height on disconnected node." );
+
+ div.css({ width: 4, height: 4 });
+
+ equals( div.css("width"), "4px", "Width on disconnected node." );
+ equals( div.css("height"), "4px", "Height on disconnected node." );
+
+ var div2 = jQuery( "
").appendTo("body");
+
+ equals( div2.find("input").css("width"), "0px", "Width on hidden input." );
+ equals( div2.find("input").css("height"), "0px", "Height on hidden input." );
+
+ equals( div2.find("textarea").css("width"), "0px", "Width on hidden textarea." );
+ equals( div2.find("textarea").css("height"), "0px", "Height on hidden textarea." );
+
+ div2.remove();
+
// handle negative numbers by ignoring #1599, #4216
jQuery('#nothiddendiv').css({ 'width': 1, 'height': 1 });
@@ -113,9 +133,8 @@ test("css(String, Object)", function() {
// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();
- j.css("padding-left", "1px");
- equals( j.css("padding-left"), "1px", "Check node,textnode,comment css works" );
-
+ j.css("overflow", "visible");
+ equals( j.css("overflow"), "visible", "Check node,textnode,comment css works" );
// opera sometimes doesn't update 'display' correctly, see #2037
jQuery("#t2037")[0].innerHTML = jQuery("#t2037")[0].innerHTML
equals( jQuery("#t2037 .hidden").css("display"), "none", "Make sure browser thinks it is hidden" );
@@ -138,7 +157,7 @@ test("css(String, Object)", function() {
ok( success, "Setting RGBA values does not throw Error" );
});
-if(jQuery.browser.msie) {
+if ( !jQuery.support.opacity ) {
test("css(String, Object) for MSIE", function() {
// for #1438, IE throws JS error when filter exists but doesn't have opacity in it
jQuery('#foo').css("filter", "progid:DXImageTransform.Microsoft.Chroma(color='red');");
@@ -300,4 +319,4 @@ test(":visible selector works properly on children with a hidden parent (bug #45
expect(1);
jQuery('#table').css('display', 'none').html('
cell | cell |
');
equals(jQuery('#table td:visible').length, 0, "hidden cell children not perceived as visible");
-});
\ No newline at end of file
+});