// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
- style[ name ] = value;
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
}
} else {
});
test("css(String, Object)", function() {
- expect(21);
+ expect(22);
ok( jQuery('#nothiddendiv').is(':visible'), 'Modifying CSS display: Assert element is visible');
jQuery('#nothiddendiv').css("display", 'none');
equals( ret, div, "Make sure setting undefined returns the original set." );
equals( div.css("display"), display, "Make sure that the display wasn't changed." );
+
+ // Test for Bug #5509
+ var success = true;
+ try {
+ jQuery('#foo').css("backgroundColor", "rgba(0, 0, 0, 0.1)");
+ }
+ catch (e) {
+ success = false;
+ }
+ ok( success, "Setting RGBA values does not throw Error" );
});
if(jQuery.browser.msie) {