")
.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();
});
@@ -320,3 +320,25 @@ test(":visible selector works properly on children with a hidden parent (bug #45
jQuery('#table').css('display', 'none').html('
cell | cell |
');
equals(jQuery('#table td:visible').length, 0, "hidden cell children not perceived as visible");
});
+
+test("internal ref to elem.runtimeStyle (bug #7608)", function () {
+ expect(1);
+
+ var result = true,
+ val = 10;
+
+ jQuery('
').appendTo("#main");
+
+ try {
+ // the bug is located within src/css.js
+ jQuery("#bug7608 #test").animate( { width: val }, 1000);
+
+ } catch (e) {
+ result = false;
+ }
+
+ ok( result, "elem.runtimeStyle does not throw exception" );
+
+ jQuery("#bug7608").remove();
+});