aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2012-12-08 18:04:13 -0500
committerRichard Gibson <richard.gibson@gmail.com>2012-12-08 18:04:13 -0500
commitd343e6b9ed501052f1676694d5e53649c92e65a0 (patch)
tree50879e4c04e34f7c51e2aa21958203242808b006 /test/unit
parent23d7cf0488bfeaab51d8f55435cab01f5cf990ca (diff)
downloadjquery-d343e6b9ed501052f1676694d5e53649c92e65a0.tar.gz
jquery-d343e6b9ed501052f1676694d5e53649c92e65a0.zip
Fix #12904: Firefox defaultDisplay with body/iframe display:none. Report and solution by @maranomynet; test by @rwldrn.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/css.js48
1 files changed, 31 insertions, 17 deletions
diff --git a/test/unit/css.js b/test/unit/css.js
index 94d972793..c90011687 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -574,19 +574,33 @@ test( "show() resolves correct default display for detached nodes", function(){
test("show() resolves correct default display #10227", function() {
expect(2);
- jQuery("html").append(
+ var body = jQuery("body");
+ body.append(
"<p id='ddisplay'>a<style>body{display:none}</style></p>"
);
- equal( jQuery("body").css("display"), "none", "Initial display: none" );
+ equal( body.css("display"), "none", "Initial display: none" );
- jQuery("body").show();
-
- equal( jQuery("body").css("display"), "block", "Correct display: block" );
+ body.show();
+ equal( body.css("display"), "block", "Correct display: block" );
jQuery("#ddisplay").remove();
+ QUnit.expectJqData( body[0], "olddisplay" );
+});
+
+test("show() resolves correct default display when iframe display:none #12904", function() {
+ expect(2);
+
+ var ddisplay = jQuery(
+ "<p id='ddisplay'>a<style>p{display:none}iframe{display:none !important}</style></p>"
+ ).appendTo("body");
+
+ equal( ddisplay.css("display"), "none", "Initial display: none" );
+
+ ddisplay.show();
+ equal( ddisplay.css("display"), "block", "Correct display: block" );
- jQuery.cache = {};
+ ddisplay.remove();
});
test("toggle()", function() {
@@ -871,17 +885,17 @@ test( "cssHooks - expand", function() {
test( "css opacity consistency across browsers (#12685)", function() {
expect( 4 );
- var fixture = jQuery("#qunit-fixture"),
- style = jQuery("<style>.opacityWithSpaces_t12685 { opacity: 0.1; filter: alpha(opacity = 10); } .opacityNoSpaces_t12685 { opacity: 0.2; filter: alpha(opacity=20); }</style>").appendTo(fixture),
- el = jQuery("<div class='opacityWithSpaces_t12685'></div>").appendTo(fixture);
-
- equal( Math.round( el.css("opacity") * 100 ), 10, "opacity from style sheet (filter:alpha with spaces)" );
- el.removeClass("opacityWithSpaces_t12685").addClass("opacityNoSpaces_t12685");
- equal( Math.round( el.css("opacity") * 100 ), 20, "opacity from style sheet (filter:alpha without spaces)" );
- el.css( "opacity", 0.3 );
- equal( Math.round( el.css("opacity") * 100 ), 30, "override opacity" );
- el.css( "opacity", "" );
- equal( Math.round( el.css("opacity") * 100 ), 20, "remove opacity override" );
+ var fixture = jQuery("#qunit-fixture"),
+ style = jQuery("<style>.opacityWithSpaces_t12685 { opacity: 0.1; filter: alpha(opacity = 10); } .opacityNoSpaces_t12685 { opacity: 0.2; filter: alpha(opacity=20); }</style>").appendTo(fixture),
+ el = jQuery("<div class='opacityWithSpaces_t12685'></div>").appendTo(fixture);
+
+ equal( Math.round( el.css("opacity") * 100 ), 10, "opacity from style sheet (filter:alpha with spaces)" );
+ el.removeClass("opacityWithSpaces_t12685").addClass("opacityNoSpaces_t12685");
+ equal( Math.round( el.css("opacity") * 100 ), 20, "opacity from style sheet (filter:alpha without spaces)" );
+ el.css( "opacity", 0.3 );
+ equal( Math.round( el.css("opacity") * 100 ), 30, "override opacity" );
+ el.css( "opacity", "" );
+ equal( Math.round( el.css("opacity") * 100 ), 20, "remove opacity override" );
});
}