@@ -407,7 +407,7 @@ testIframe("offset/table", "table", function( $ ) {
407
407
} ) ;
408
408
409
409
testIframe ( "offset/scroll" , "scroll" , function ( $ , win ) {
410
- expect ( 24 ) ;
410
+ expect ( 28 ) ;
411
411
412
412
equal ( $ ( "#scroll-1" ) . offset ( ) . top , 7 , "jQuery('#scroll-1').offset().top" ) ;
413
413
equal ( $ ( "#scroll-1" ) . offset ( ) . left , 7 , "jQuery('#scroll-1').offset().left" ) ;
@@ -457,6 +457,17 @@ testIframe("offset/scroll", "scroll", function( $, win ) {
457
457
notEqual ( $ ( ) . scrollLeft ( null ) , null , "jQuery().scrollLeft(null) testing setter on empty jquery object" ) ;
458
458
strictEqual ( $ ( ) . scrollTop ( ) , null , "jQuery().scrollTop(100) testing setter on empty jquery object" ) ;
459
459
strictEqual ( $ ( ) . scrollLeft ( ) , null , "jQuery().scrollLeft(100) testing setter on empty jquery object" ) ;
460
+
461
+ // Tests position after parent scrolling (#15239)
462
+ $ ( "#scroll-1" ) . scrollTop ( 0 ) ;
463
+ $ ( "#scroll-1" ) . scrollLeft ( 0 ) ;
464
+ equal ( $ ( "#scroll-1-1" ) . position ( ) . top , 6 , "jQuery('#scroll-1-1').position().top unaffected by parent scrolling" ) ;
465
+ equal ( $ ( "#scroll-1-1" ) . position ( ) . left , 6 , "jQuery('#scroll-1-1').position().left unaffected by parent scrolling" ) ;
466
+
467
+ $ ( "#scroll-1" ) . scrollTop ( 5 ) ;
468
+ $ ( "#scroll-1" ) . scrollLeft ( 5 ) ;
469
+ equal ( $ ( "#scroll-1-1" ) . position ( ) . top , 6 , "jQuery('#scroll-1-1').position().top unaffected by parent scrolling" ) ;
470
+ equal ( $ ( "#scroll-1-1" ) . position ( ) . left , 6 , "jQuery('#scroll-1-1').position().left unaffected by parent scrolling" ) ;
460
471
} ) ;
461
472
462
473
testIframe ( "offset/body" , "body" , function ( $ ) {
0 commit comments