aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2013-09-17 16:06:21 +0400
committerOleg <markelog@gmail.com>2013-09-17 16:16:47 +0400
commitfd2964237f07d8b6985df2145a4990f96eddba87 (patch)
tree106035479d4c80df949d20c3ed222bac8ff6a7a4 /test/unit
parent303e41d996317611ee3397ba018b9d4c8fafde47 (diff)
downloadjquery-fd2964237f07d8b6985df2145a4990f96eddba87.tar.gz
jquery-fd2964237f07d8b6985df2145a4990f96eddba87.zip
Fix #12723 and simplification and optmization of defaultDisplay helper
(cherry picked from commit a25343001eea2436dcf8ea60deea3844f77e42e4)
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/css.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/unit/css.js b/test/unit/css.js
index 23e52aca7..b4446bec3 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -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" );
+
+ 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();
- QUnit.expectJqData( body[0], "olddisplay" );
+ jQuery( ".ddisplay" ).remove();
});
test("show() resolves correct default display when iframe display:none #12904", function() {