X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=inline;f=test%2Funit%2Fcss.js;h=8f24e2e347cb852fd8767cb3072ace1ba2fa3062;hb=4fc86d5eb1d4eaa3efad77dc224271d254f491e4;hp=4921391017f3d9f55bebf89042dbe4fc1031a259;hpb=cd8f4917ba1a6605b618fef1ac37b370604cd58b;p=jquery.git
diff --git a/test/unit/css.js b/test/unit/css.js
index 4921391..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("fontSize", "15px");
- equals( j.css("fontSize"), "15px", "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" );