@@ -35,13 +35,6 @@ QUnit.module( "offset", { setup: function() {
35
35
forceScroll . detach ( ) ;
36
36
} , teardown : moduleTeardown } ) ;
37
37
38
- /*
39
- Closure-compiler will roll static methods off of the jQuery object and so they will
40
- not be passed with the jQuery object across the windows. To differentiate this, the
41
- testIframe callbacks use the "$" symbol to refer to the jQuery object passed from
42
- the iframe window and the "jQuery" symbol is used to access any static methods.
43
- */
44
-
45
38
QUnit . test ( "empty set" , function ( assert ) {
46
39
assert . expect ( 2 ) ;
47
40
assert . strictEqual ( jQuery ( ) . offset ( ) , undefined , "offset() returns undefined for empty set (#11962)" ) ;
@@ -75,7 +68,7 @@ QUnit.test( "hidden (display: none) element", function( assert ) {
75
68
assert . equal ( result . left , 0 , "Retrieving offset on hidden elements returns zeros (gh-2310)" ) ;
76
69
} ) ;
77
70
78
- testIframe ( "offset/ absolute" , "absolute" , function ( $ , iframe , document , assert ) {
71
+ testIframeWithCallback ( "absolute" , "offset/ absolute.html " , function ( $ , iframe , document , assert ) {
79
72
assert . expect ( 4 ) ;
80
73
81
74
var doc = iframe . document ,
@@ -100,7 +93,7 @@ testIframe( "offset/absolute", "absolute", function( $, iframe, document, assert
100
93
} ) ;
101
94
} ) ;
102
95
103
- testIframe ( "offset/ absolute" , "absolute" , function ( $ , window , document , assert ) {
96
+ testIframeWithCallback ( "absolute" , "offset/ absolute.html " , function ( $ , window , document , assert ) {
104
97
assert . expect ( 178 ) ;
105
98
106
99
var tests , offset ;
@@ -185,7 +178,7 @@ testIframe( "offset/absolute", "absolute", function( $, window, document, assert
185
178
} ) ;
186
179
} ) ;
187
180
188
- testIframe ( "offset/ relative" , "relative" , function ( $ , window , document , assert ) {
181
+ testIframeWithCallback ( "relative" , "offset/ relative.html " , function ( $ , window , document , assert ) {
189
182
assert . expect ( 64 ) ;
190
183
191
184
// get offset
@@ -243,7 +236,7 @@ testIframe( "offset/relative", "relative", function( $, window, document, assert
243
236
} ) ;
244
237
} ) ;
245
238
246
- testIframe ( "offset/ static" , "static" , function ( $ , window , document , assert ) {
239
+ testIframeWithCallback ( "static" , "offset/ static.html " , function ( $ , window , document , assert ) {
247
240
assert . expect ( 80 ) ;
248
241
249
242
// get offset
@@ -305,7 +298,7 @@ testIframe( "offset/static", "static", function( $, window, document, assert ) {
305
298
} ) ;
306
299
} ) ;
307
300
308
- testIframe ( "offset/ fixed" , "fixed" , function ( $ , window , document , assert ) {
301
+ testIframeWithCallback ( "fixed" , "offset/ fixed.html " , function ( $ , window , document , assert ) {
309
302
assert . expect ( 34 ) ;
310
303
311
304
var tests , $noTopLeft ;
@@ -395,7 +388,7 @@ testIframe( "offset/fixed", "fixed", function( $, window, document, assert ) {
395
388
}
396
389
} ) ;
397
390
398
- testIframe ( "offset/ table" , "table" , function ( $ , window , document , assert ) {
391
+ testIframeWithCallback ( "table" , "offset/ table.html " , function ( $ , window , document , assert ) {
399
392
assert . expect ( 4 ) ;
400
393
401
394
assert . equal ( $ ( "#table-1" ) . offset ( ) . top , 6 , "jQuery('#table-1').offset().top" ) ;
@@ -405,7 +398,7 @@ testIframe( "offset/table", "table", function( $, window, document, assert ) {
405
398
assert . equal ( $ ( "#th-1" ) . offset ( ) . left , 10 , "jQuery('#th-1').offset().left" ) ;
406
399
} ) ;
407
400
408
- testIframe ( "offset/ scroll" , "scroll" , function ( $ , win , doc , assert ) {
401
+ testIframeWithCallback ( "scroll" , "offset/ scroll.html " , function ( $ , win , doc , assert ) {
409
402
assert . expect ( 26 ) ;
410
403
411
404
assert . equal ( $ ( "#scroll-1" ) . offset ( ) . top , 7 , "jQuery('#scroll-1').offset().top" ) ;
@@ -464,7 +457,7 @@ testIframe( "offset/scroll", "scroll", function( $, win, doc, assert ) {
464
457
assert . strictEqual ( $ ( ) . scrollLeft ( ) , undefined , "jQuery().scrollLeft() testing getter on empty jquery object" ) ;
465
458
} ) ;
466
459
467
- testIframe ( "offset/ body" , "body" , function ( $ , window , document , assert ) {
460
+ testIframeWithCallback ( "body" , "offset/ body.html " , function ( $ , window , document , assert ) {
468
461
assert . expect ( 4 ) ;
469
462
470
463
assert . equal ( $ ( "body" ) . offset ( ) . top , 1 , "jQuery('#body').offset().top" ) ;
0 commit comments