Skip to content

Commit 60f546a

Browse files
committed
body default display is always block. @mikesherov was right and this is the proof. Fixes #10227
1 parent 52a8422 commit 60f546a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/css.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var curCSS, iframe, iframeDoc,
99
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
1010
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
1111
rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
12-
elemdisplay = {},
12+
elemdisplay = { BODY: "block" },
1313

1414
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
1515
cssNormalTransform = {

test/unit/css.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,24 @@ test( "show() resolves correct default display, detached nodes (#10006)", functi
560560
div.remove();
561561
});
562562

563+
test("show() resolves correct default display #10227", function() {
564+
expect(2);
565+
566+
jQuery("html").append(
567+
"<p id='ddisplay'>a<style>body{display:none}</style><p>"
568+
);
569+
570+
equal( jQuery("body").css("display"), "none", "Initial display: none" );
571+
572+
jQuery("body").show();
573+
574+
equal( jQuery("body").css("display"), "block", "Correct display: block" );
575+
576+
jQuery("#ddisplay").remove();
577+
578+
jQuery.cache = {};
579+
});
580+
563581
test("toggle()", function() {
564582
expect(9);
565583
var div,

0 commit comments

Comments
 (0)