Do not set boolean attributes to empty string on removal. Fixes #10870. +0 bytes compressed

This commit is contained in:
timmywil
2012-03-05 12:54:44 -05:00
parent 8013163a36
commit d3320462df
2 changed files with 11 additions and 4 deletions

View File

@@ -464,7 +464,7 @@ test("attr('tabindex', value)", function() {
});
test("removeAttr(String)", function() {
expect(9);
expect( 10 );
var $first;
equal( jQuery("#mark").removeAttr( "class" ).attr("class"), undefined, "remove class" );
@@ -479,6 +479,9 @@ test("removeAttr(String)", function() {
jQuery("#text1").prop("readOnly", true).removeAttr("readonly");
equal( document.getElementById("text1").readOnly, false, "removeAttr sets boolean properties to false" );
jQuery("#option2c").removeAttr("selected");
equal( jQuery("#option2d").attr("selected"), "selected", "Removing `selected` from an option that is not selected does not remove selected from the currently selected option (#10870)");
try {
$first = jQuery("#first").attr("contenteditable", "true").removeAttr("contenteditable");
equal( $first.attr('contenteditable'), undefined, "Remove the contenteditable attribute" );