body default display is always block. @mikesherov was right and this is the proof. Fixes #10227

This commit is contained in:
Rick Waldron 2012-10-04 13:25:50 -04:00
parent 52a8422559
commit 60f546acb1
2 changed files with 19 additions and 1 deletions

View File

@ -9,7 +9,7 @@ var curCSS, iframe, iframeDoc,
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ), rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
elemdisplay = {}, elemdisplay = { BODY: "block" },
cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssNormalTransform = { cssNormalTransform = {

View File

@ -560,6 +560,24 @@ test( "show() resolves correct default display, detached nodes (#10006)", functi
div.remove(); 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() { test("toggle()", function() {
expect(9); expect(9);
var div, var div,