expect( 2 );
var el;
- el = jQuery( "<div></div>" ).css( "color", "black" ).css( "color", "fake value" );
- equal( el.css( "color" ), "black", "The old style is kept when setting an unrecognized value" );
- el = jQuery( "<div></div>" ).css( "color", "black" ).css( "color", " " );
- equal( el.css( "color" ), "black", "The old style is kept when setting to a space" );
+ el = jQuery( "<div></div>" ).css( "position", "absolute" ).css( "position", "fake value" );
+ equal( el.css( "position" ), "absolute", "The old style is kept when setting an unrecognized value" );
+ el = jQuery( "<div></div>" ).css( "position", "absolute" ).css( "position", " " );
+ equal( el.css( "position" ), "absolute", "The old style is kept when setting to a space" );
});
test( "Reset the style if set to an empty string", function() {
expect( 1 );
- var el = jQuery( "<div></div>" ).css( "color", "black" ).css( "color", "" );
- equal( el.css( "color" ), "", "The style can be reset by setting to an empty string" );
+ var el = jQuery( "<div></div>" ).css( "position", "absolute" ).css( "position", "" );
+ // Some browsers return an empty string; others "static". Both those cases mean the style
+ // was reset successfully so accept them both.
+ equal( el.css( "position" ) || "static", "static",
+ "The style can be reset by setting to an empty string" );
});
asyncTest( "Clearing a Cloned Element's Style Shouldn't Clear the Original Element's Style (#8908)", 24, function() {