@@ -574,19 +574,33 @@ test( "show() resolves correct default display for detached nodes", function(){
574
574
test ( "show() resolves correct default display #10227" , function ( ) {
575
575
expect ( 2 ) ;
576
576
577
- jQuery ( "html" ) . append (
577
+ var body = jQuery ( "body" ) ;
578
+ body . append (
578
579
"<p id='ddisplay'>a<style>body{display:none}</style></p>"
579
580
) ;
580
581
581
- equal ( jQuery ( " body" ) . css ( "display" ) , "none" , "Initial display: none" ) ;
582
+ equal ( body . css ( "display" ) , "none" , "Initial display: none" ) ;
582
583
583
- jQuery ( "body" ) . show ( ) ;
584
-
585
- equal ( jQuery ( "body" ) . css ( "display" ) , "block" , "Correct display: block" ) ;
584
+ body . show ( ) ;
585
+ equal ( body . css ( "display" ) , "block" , "Correct display: block" ) ;
586
586
587
587
jQuery ( "#ddisplay" ) . remove ( ) ;
588
+ QUnit . expectJqData ( body [ 0 ] , "olddisplay" ) ;
589
+ } ) ;
590
+
591
+ test ( "show() resolves correct default display when iframe display:none #12904" , function ( ) {
592
+ expect ( 2 ) ;
593
+
594
+ var ddisplay = jQuery (
595
+ "<p id='ddisplay'>a<style>p{display:none}iframe{display:none !important}</style></p>"
596
+ ) . appendTo ( "body" ) ;
597
+
598
+ equal ( ddisplay . css ( "display" ) , "none" , "Initial display: none" ) ;
599
+
600
+ ddisplay . show ( ) ;
601
+ equal ( ddisplay . css ( "display" ) , "block" , "Correct display: block" ) ;
588
602
589
- jQuery . cache = { } ;
603
+ ddisplay . remove ( ) ;
590
604
} ) ;
591
605
592
606
test ( "toggle()" , function ( ) {
@@ -871,17 +885,17 @@ test( "cssHooks - expand", function() {
871
885
test ( "css opacity consistency across browsers (#12685)" , function ( ) {
872
886
expect ( 4 ) ;
873
887
874
- var fixture = jQuery ( "#qunit-fixture" ) ,
875
- style = jQuery ( "<style>.opacityWithSpaces_t12685 { opacity: 0.1; filter: alpha(opacity = 10); } .opacityNoSpaces_t12685 { opacity: 0.2; filter: alpha(opacity=20); }</style>" ) . appendTo ( fixture ) ,
876
- el = jQuery ( "<div class='opacityWithSpaces_t12685'></div>" ) . appendTo ( fixture ) ;
877
-
878
- equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 10 , "opacity from style sheet (filter:alpha with spaces)" ) ;
879
- el . removeClass ( "opacityWithSpaces_t12685" ) . addClass ( "opacityNoSpaces_t12685" ) ;
880
- equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 20 , "opacity from style sheet (filter:alpha without spaces)" ) ;
881
- el . css ( "opacity" , 0.3 ) ;
882
- equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 30 , "override opacity" ) ;
883
- el . css ( "opacity" , "" ) ;
884
- equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 20 , "remove opacity override" ) ;
888
+ var fixture = jQuery ( "#qunit-fixture" ) ,
889
+ style = jQuery ( "<style>.opacityWithSpaces_t12685 { opacity: 0.1; filter: alpha(opacity = 10); } .opacityNoSpaces_t12685 { opacity: 0.2; filter: alpha(opacity=20); }</style>" ) . appendTo ( fixture ) ,
890
+ el = jQuery ( "<div class='opacityWithSpaces_t12685'></div>" ) . appendTo ( fixture ) ;
891
+
892
+ equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 10 , "opacity from style sheet (filter:alpha with spaces)" ) ;
893
+ el . removeClass ( "opacityWithSpaces_t12685" ) . addClass ( "opacityNoSpaces_t12685" ) ;
894
+ equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 20 , "opacity from style sheet (filter:alpha without spaces)" ) ;
895
+ el . css ( "opacity" , 0.3 ) ;
896
+ equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 30 , "override opacity" ) ;
897
+ el . css ( "opacity" , "" ) ;
898
+ equal ( Math . round ( el . css ( "opacity" ) * 100 ) , 20 , "remove opacity override" ) ;
885
899
} ) ;
886
900
887
901
}
0 commit comments