mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 21:15:01 -05:00
Fix #12723 and simplification and optmization of defaultDisplay helper
(cherry picked from commit a25343001e)
This commit is contained in:
@@ -583,21 +583,25 @@ test( "show() resolves correct default display for detached nodes", function(){
|
||||
span.remove();
|
||||
});
|
||||
|
||||
test("show() resolves correct default display #10227", function() {
|
||||
expect(2);
|
||||
test("show() resolves correct default display #10227", 4, function() {
|
||||
var html = jQuery( document.documentElement ),
|
||||
body = jQuery( "body" );
|
||||
|
||||
var body = jQuery("body");
|
||||
body.append(
|
||||
"<p id='ddisplay'>a<style>body{display:none}</style></p>"
|
||||
);
|
||||
body.append( "<p class='ddisplay'>a<style>body{display:none}</style></p>" );
|
||||
|
||||
equal( body.css("display"), "none", "Initial display: none" );
|
||||
equal( body.css("display"), "none", "Initial display for body element: none" );
|
||||
|
||||
body.show();
|
||||
equal( body.css("display"), "block", "Correct display: block" );
|
||||
equal( body.css("display"), "block", "Correct display for body element: block" );
|
||||
|
||||
jQuery("#ddisplay").remove();
|
||||
QUnit.expectJqData( body[0], "olddisplay" );
|
||||
body.append( "<p class='ddisplay'>a<style>html{display:none}</style></p>" );
|
||||
|
||||
equal( html.css("display"), "none", "Initial display for html element: none" );
|
||||
|
||||
html.show();
|
||||
equal( html.css( "display" ), "block", "Correct display for html element: block" );
|
||||
|
||||
jQuery( ".ddisplay" ).remove();
|
||||
});
|
||||
|
||||
test("show() resolves correct default display when iframe display:none #12904", function() {
|
||||
|
||||
Reference in New Issue
Block a user