@@ -407,7 +407,7 @@ testIframe("offset/table", "table", function( $ ) {
407407} ) ;
408408
409409testIframe ( "offset/scroll" , "scroll" , function ( $ , win ) {
410- expect ( 24 ) ;
410+ expect ( 28 ) ;
411411
412412 equal ( $ ( "#scroll-1" ) . offset ( ) . top , 7 , "jQuery('#scroll-1').offset().top" ) ;
413413 equal ( $ ( "#scroll-1" ) . offset ( ) . left , 7 , "jQuery('#scroll-1').offset().left" ) ;
@@ -457,6 +457,17 @@ testIframe("offset/scroll", "scroll", function( $, win ) {
457457 notEqual ( $ ( ) . scrollLeft ( null ) , null , "jQuery().scrollLeft(null) testing setter on empty jquery object" ) ;
458458 strictEqual ( $ ( ) . scrollTop ( ) , null , "jQuery().scrollTop(100) testing setter on empty jquery object" ) ;
459459 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" ) ;
460471} ) ;
461472
462473testIframe ( "offset/body" , "body" , function ( $ ) {
0 commit comments