aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2012-10-04 13:25:50 -0400
committerRick Waldron <waldron.rick@gmail.com>2012-10-04 13:25:50 -0400
commit60f546acb1c7136092b4fd01cccff052e468cc72 (patch)
tree9477dad99e214ee057d7edcd3e6340cc4755b588
parent52a84225596393879806ad9e024c3351c8b46034 (diff)
downloadjquery-60f546acb1c7136092b4fd01cccff052e468cc72.tar.gz
jquery-60f546acb1c7136092b4fd01cccff052e468cc72.zip
body default display is always block. @mikesherov was right and this is the proof. Fixes #10227
-rw-r--r--src/css.js2
-rw-r--r--test/unit/css.js18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/css.js b/src/css.js
index 403516e0f..99d578873 100644
--- a/src/css.js
+++ b/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 = {
diff --git a/test/unit/css.js b/test/unit/css.js
index be8597a62..25f6b9815 100644
--- a/test/unit/css.js
+++ b/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,