@@ -156,27 +156,27 @@ test("css(String, Object)", function() {
156
156
} ) ;
157
157
158
158
if ( ! jQuery . support . opacity ) {
159
- test ( "css(String, Object) for MSIE" , function ( ) {
160
- // for #1438, IE throws JS error when filter exists but doesn't have opacity in it
159
+ test ( "css(String, Object) for MSIE" , function ( ) {
160
+ // for #1438, IE throws JS error when filter exists but doesn't have opacity in it
161
161
jQuery ( '#foo' ) . css ( "filter" , "progid:DXImageTransform.Microsoft.Chroma(color='red');" ) ;
162
- equals ( jQuery ( '#foo' ) . css ( 'opacity' ) , '1' , "Assert opacity is 1 when a different filter is set in IE, #1438" ) ;
163
-
164
- var filterVal = "progid:DXImageTransform.Microsoft.Alpha(opacity=30) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)" ;
165
- var filterVal2 = "progid:DXImageTransform.Microsoft.alpha(opacity=100) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)" ;
166
- var filterVal3 = "progid:DXImageTransform.Microsoft.Blur(pixelradius=5)" ;
167
- jQuery ( '#foo' ) . css ( "filter" , filterVal ) ;
168
- equals ( jQuery ( '#foo' ) . css ( "filter" ) , filterVal , "css('filter', val) works" ) ;
169
- jQuery ( '#foo' ) . css ( "opacity" , 1 ) ;
170
- equals ( jQuery ( '#foo' ) . css ( "filter" ) , filterVal2 , "Setting opacity in IE doesn't duplicate opacity filter" ) ;
171
- equals ( jQuery ( '#foo' ) . css ( "opacity" ) , 1 , "Setting opacity in IE with other filters works" ) ;
172
- jQuery ( '#foo' ) . css ( "filter" , filterVal3 ) . css ( "opacity" , 1 ) ;
173
- ok ( jQuery ( '#foo' ) . css ( "filter" ) . indexOf ( filterVal3 ) !== - 1 , "Setting opacity in IE doesn't clobber other filters" ) ;
174
- } ) ;
162
+ equals ( jQuery ( '#foo' ) . css ( 'opacity' ) , '1' , "Assert opacity is 1 when a different filter is set in IE, #1438" ) ;
163
+
164
+ var filterVal = "progid:DXImageTransform.Microsoft.Alpha(opacity=30) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)" ;
165
+ var filterVal2 = "progid:DXImageTransform.Microsoft.alpha(opacity=100) progid:DXImageTransform.Microsoft.Blur(pixelradius=5)" ;
166
+ var filterVal3 = "progid:DXImageTransform.Microsoft.Blur(pixelradius=5)" ;
167
+ jQuery ( '#foo' ) . css ( "filter" , filterVal ) ;
168
+ equals ( jQuery ( '#foo' ) . css ( "filter" ) , filterVal , "css('filter', val) works" ) ;
169
+ jQuery ( '#foo' ) . css ( "opacity" , 1 ) ;
170
+ equals ( jQuery ( '#foo' ) . css ( "filter" ) , filterVal2 , "Setting opacity in IE doesn't duplicate opacity filter" ) ;
171
+ equals ( jQuery ( '#foo' ) . css ( "opacity" ) , 1 , "Setting opacity in IE with other filters works" ) ;
172
+ jQuery ( '#foo' ) . css ( "filter" , filterVal3 ) . css ( "opacity" , 1 ) ;
173
+ ok ( jQuery ( '#foo' ) . css ( "filter" ) . indexOf ( filterVal3 ) !== - 1 , "Setting opacity in IE doesn't clobber other filters" ) ;
174
+ } ) ;
175
175
}
176
176
177
177
test ( "css(String, Function)" , function ( ) {
178
178
expect ( 3 ) ;
179
-
179
+
180
180
var sizes = [ "10px" , "20px" , "30px" ] ;
181
181
182
182
jQuery ( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
@@ -191,7 +191,7 @@ test("css(String, Function)", function() {
191
191
index ++ ;
192
192
return size ;
193
193
} ) ;
194
-
194
+
195
195
index = 0 ;
196
196
197
197
jQuery ( "#cssFunctionTest div" ) . each ( function ( ) {
@@ -206,7 +206,7 @@ test("css(String, Function)", function() {
206
206
207
207
test ( "css(String, Function) with incoming value" , function ( ) {
208
208
expect ( 3 ) ;
209
-
209
+
210
210
var sizes = [ "10px" , "20px" , "30px" ] ;
211
211
212
212
jQuery ( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
@@ -221,7 +221,7 @@ test("css(String, Function) with incoming value", function() {
221
221
index ++ ;
222
222
return size ;
223
223
} ) ;
224
-
224
+
225
225
index = 0 ;
226
226
227
227
jQuery ( "#cssFunctionTest div" ) . css ( "font-size" , function ( i , computedSize ) {
@@ -236,7 +236,7 @@ test("css(String, Function) with incoming value", function() {
236
236
237
237
test ( "css(Object) where values are Functions" , function ( ) {
238
238
expect ( 3 ) ;
239
-
239
+
240
240
var sizes = [ "10px" , "20px" , "30px" ] ;
241
241
242
242
jQuery ( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
@@ -251,22 +251,22 @@ test("css(Object) where values are Functions", function() {
251
251
index ++ ;
252
252
return size ;
253
253
} } ) ;
254
-
254
+
255
255
index = 0 ;
256
-
256
+
257
257
jQuery ( "#cssFunctionTest div" ) . each ( function ( ) {
258
258
var computedSize = jQuery ( this ) . css ( "font-size" )
259
259
var expectedSize = sizes [ index ]
260
260
equals ( computedSize , expectedSize , "Div #" + index + " should be " + expectedSize ) ;
261
261
index ++ ;
262
262
} ) ;
263
-
263
+
264
264
jQuery ( "#cssFunctionTest" ) . remove ( ) ;
265
265
} ) ;
266
266
267
267
test ( "css(Object) where values are Functions with incoming values" , function ( ) {
268
268
expect ( 3 ) ;
269
-
269
+
270
270
var sizes = [ "10px" , "20px" , "30px" ] ;
271
271
272
272
jQuery ( "<div id='cssFunctionTest'><div class='cssFunction'></div>" +
@@ -281,16 +281,16 @@ test("css(Object) where values are Functions with incoming values", function() {
281
281
index ++ ;
282
282
return size ;
283
283
} } ) ;
284
-
284
+
285
285
index = 0 ;
286
-
286
+
287
287
jQuery ( "#cssFunctionTest div" ) . css ( { "font-size" : function ( i , computedSize ) {
288
288
var expectedSize = sizes [ index ]
289
289
equals ( computedSize , expectedSize , "Div #" + index + " should be " + expectedSize ) ;
290
290
index ++ ;
291
291
return computedSize ;
292
292
} } ) ;
293
-
293
+
294
294
jQuery ( "#cssFunctionTest" ) . remove ( ) ;
295
295
} ) ;
296
296
0 commit comments