Skip to content

Commit d947895

Browse files
committed
Limit the scope of the CSS 'auto' change to just height/width. Fixes #7393.
1 parent 335e0a3 commit d947895

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/css.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jQuery.each(["height", "width"], function( i, name ) {
177177
}
178178

179179
if ( val != null ) {
180-
return val;
180+
return val === "" ? "auto" : val;
181181
}
182182
}
183183

@@ -252,7 +252,7 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) {
252252
}
253253
}
254254

255-
return ret === "" ? "auto" : ret;
255+
return ret;
256256
};
257257
}
258258

test/unit/effects.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ test("sanity check", function() {
66
});
77

88
test("show()", function() {
9-
expect(27);
9+
expect(28);
1010

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

1313
hiddendiv.hide().show();
1414

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

17+
var div = jQuery("<div>").hide().appendTo("body").show();
18+
19+
equal( div.css("display"), "block", "Make sure pre-hidden divs show" );
20+
1721
QUnit.reset();
1822

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

0 commit comments

Comments
 (0)