Skip to content

Commit

Permalink
Limit the scope of the CSS 'auto' change to just height/width. Fixes …
Browse files Browse the repository at this point in the history
…#7393.
  • Loading branch information
jeresig committed Nov 3, 2010
1 parent 335e0a3 commit d947895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/css.js
Expand Up @@ -177,7 +177,7 @@ jQuery.each(["height", "width"], function( i, name ) {
}

if ( val != null ) {
return val;
return val === "" ? "auto" : val;
}
}

Expand Down Expand Up @@ -252,7 +252,7 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
}
}

return ret === "" ? "auto" : ret;
return ret;
};
}

Expand Down
6 changes: 5 additions & 1 deletion test/unit/effects.js
Expand Up @@ -6,14 +6,18 @@ test("sanity check", function() {
});

test("show()", function() {
expect(27);
expect(28);

var hiddendiv = jQuery("div.hidden");

hiddendiv.hide().show();

equals( hiddendiv.css("display"), "block", "Make sure a pre-hidden div is visible." );

var div = jQuery("<div>").hide().appendTo("body").show();

equal( div.css("display"), "block", "Make sure pre-hidden divs show" );

QUnit.reset();

hiddendiv = jQuery("div.hidden");
Expand Down

0 comments on commit d947895

Please sign in to comment.