X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=test%2Funit%2Fcss.js;h=fbbf937ca6e2b54ec5927c073f001b49876f0668;hp=cddd90256ec74d4bc051955d8bb1f41e48395dd1;hb=3e0cc815043c2425819743e907a0ce263a7ce164;hpb=429b078dc7b5cf7765b44c8d32e125ecd8f1e2c9 diff --git a/test/unit/css.js b/test/unit/css.js index cddd902..fbbf937 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -178,24 +178,24 @@ if ( !jQuery.support.opacity ) { test("css(String, Function)", function() { expect(3); - + var sizes = ["10px", "20px", "30px"]; - - jQuery("
" + - "
" + + + jQuery("
" + + "
" + "
") .appendTo("body"); - + var index = 0; - + jQuery("#cssFunctionTest div").css("font-size", function() { var size = sizes[index]; index++; return size; }); - + index = 0; - + jQuery("#cssFunctionTest div").each(function() { var computedSize = jQuery(this).css("font-size") var expectedSize = sizes[index] @@ -208,24 +208,24 @@ test("css(String, Function)", function() { test("css(String, Function) with incoming value", function() { expect(3); - + var sizes = ["10px", "20px", "30px"]; - - jQuery("
" + - "
" + + + jQuery("
" + + "
" + "
") .appendTo("body"); - + var index = 0; - + jQuery("#cssFunctionTest div").css("font-size", function() { var size = sizes[index]; index++; return size; }); - + index = 0; - + jQuery("#cssFunctionTest div").css("font-size", function(i, computedSize) { var expectedSize = sizes[index] equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); @@ -238,61 +238,61 @@ test("css(String, Function) with incoming value", function() { test("css(Object) where values are Functions", function() { expect(3); - + var sizes = ["10px", "20px", "30px"]; - - jQuery("
" + - "
" + + + jQuery("
" + + "
" + "
") .appendTo("body"); var index = 0; - + jQuery("#cssFunctionTest div").css({fontSize: function() { var size = sizes[index]; index++; return size; }}); - + index = 0; - + jQuery("#cssFunctionTest div").each(function() { var computedSize = jQuery(this).css("font-size") var expectedSize = sizes[index] equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); index++; }); - + jQuery("#cssFunctionTest").remove(); }); test("css(Object) where values are Functions with incoming values", function() { expect(3); - + var sizes = ["10px", "20px", "30px"]; - - jQuery("
" + - "
" + + + jQuery("
" + + "
" + "
") .appendTo("body"); var index = 0; - + jQuery("#cssFunctionTest div").css({fontSize: function() { var size = sizes[index]; index++; return size; }}); - + index = 0; - + jQuery("#cssFunctionTest div").css({"font-size": function(i, computedSize) { var expectedSize = sizes[index] equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); index++; return computedSize; }}); - + jQuery("#cssFunctionTest").remove(); });