]> source.dussan.org Git - jquery.git/commitdiff
body default display is always block. @mikesherov was right and this is the proof...
authorRick Waldron <waldron.rick@gmail.com>
Thu, 4 Oct 2012 17:25:50 +0000 (13:25 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Thu, 4 Oct 2012 17:25:50 +0000 (13:25 -0400)
src/css.js
test/unit/css.js

index 403516e0feb990a3c8f54193f5c7af52b76abfb3..99d578873a04d7105a7e8adf59fb7f8db527037b 100644 (file)
@@ -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 = {
index be8597a622b3270e790c40afda66f23961f8be0d..25f6b981534fadd6ca6565a4ac24947a5b4a38fa 100644 (file)
@@ -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,