@@ -169,7 +169,7 @@ test("Persist correct display value", function() {
169
169
170
170
test ( "show() resolves correct default display #8099" , function ( ) {
171
171
expect ( 7 ) ;
172
- var tt8099 = jQuery ( "<tt/>" ) . appendTo ( "body" ) ,
172
+ var tt8099 = jQuery ( "<tt/>" ) . appendTo ( "body" ) ,
173
173
dfn8099 = jQuery ( "<dfn/>" , { html : "foo" } ) . appendTo ( "body" ) ;
174
174
175
175
equals ( tt8099 . css ( "display" ) , "none" , "default display override for all tt" ) ;
@@ -726,6 +726,7 @@ jQuery.each( {
726
726
var f_h = f ( elem , "height" ) ;
727
727
var t_o = t ( elem , "opacity" ) ;
728
728
var f_o = f ( elem , "opacity" ) ;
729
+
729
730
if ( f_o === "" ) {
730
731
f_o = 1 ;
731
732
}
@@ -753,22 +754,39 @@ jQuery.each( {
753
754
754
755
elem = elem [ 0 ] ;
755
756
756
- if ( t_w == "show" )
757
+ if ( t_w == "show" ) {
757
758
equals ( elem . style . display , "block" , "Showing, display should block: " + elem . style . display ) ;
759
+ }
758
760
759
- if ( t_w == "hide" || t_w == "show" )
761
+ if ( t_w == "hide" || t_w == "show" ) {
760
762
ok ( f_w === "" ? elem . style . width === f_w : elem . style . width . indexOf ( f_w ) === 0 , "Width must be reset to " + f_w + ": " + elem . style . width ) ;
763
+ }
761
764
762
- if ( t_h == "hide" || t_h == "show" )
765
+ if ( t_h == "hide" || t_h == "show" ) {
763
766
ok ( f_h === "" ? elem . style . height === f_h : elem . style . height . indexOf ( f_h ) === 0 , "Height must be reset to " + f_h + ": " + elem . style . height ) ;
767
+ }
768
+
769
+ var cur_o = jQuery . style ( elem , "opacity" ) ;
770
+
771
+ if ( f_o !== jQuery . css ( elem , "opacity" ) ) {
772
+ f_o = f ( elem , "opacity" ) ;
773
+ }
774
+
775
+ if ( f_o === "" ) {
776
+ f_o = 1 ;
777
+ }
764
778
765
- var cur_o = jQuery . css ( elem , "opacity" ) ;
779
+ if ( cur_o === "" ) {
780
+ cur_o = 1 ;
781
+ }
766
782
767
- if ( t_o == "hide" || t_o == "show" )
783
+ if ( t_o == "hide" || t_o == "show" ) {
768
784
equals ( cur_o , f_o , "Opacity must be reset to " + f_o + ": " + cur_o ) ;
785
+ }
769
786
770
- if ( t_w == "hide" )
787
+ if ( t_w == "hide" ) {
771
788
equals ( elem . style . display , "none" , "Hiding, display should be none: " + elem . style . display ) ;
789
+ }
772
790
773
791
if ( t_o . constructor == Number ) {
774
792
equals ( cur_o , t_o , "Final opacity should be " + t_o + ": " + cur_o ) ;
0 commit comments