Skip to content
Browse files

body default display is always block. @mikesherov was right and this …

…is the proof. Fixes #10227
  • Loading branch information...
1 parent 52a8422 commit 60f546acb1c7136092b4fd01cccff052e468cc72 @rwaldron rwaldron committed Oct 4, 2012
Showing with 19 additions and 1 deletion.
  1. +1 −1 src/css.js
  2. +18 −0 test/unit/css.js
View
2 src/css.js
@@ -9,7 +9,7 @@ var curCSS, iframe, iframeDoc,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
- elemdisplay = {},
+ elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = {
View
18 test/unit/css.js
@@ -560,6 +560,24 @@ test( "show() resolves correct default display, detached nodes (#10006)", functi
div.remove();
});
+test("show() resolves correct default display #10227", function() {
+ expect(2);
+
+ jQuery("html").append(
+ "<p id='ddisplay'>a<style>body{display:none}</style><p>"
+ );
+
+ equal( jQuery("body").css("display"), "none", "Initial display: none" );
+
+ jQuery("body").show();
+
+ equal( jQuery("body").css("display"), "block", "Correct display: block" );
+
+ jQuery("#ddisplay").remove();
+
+ jQuery.cache = {};
+});
+
test("toggle()", function() {
expect(9);
var div,

0 comments on commit 60f546a

Please sign in to comment.
Something went wrong with that request. Please try again.