@@ -412,7 +412,7 @@ testIframe("offset/table", "table", function( $ ) {
412412} ) ;
413413
414414testIframe ( "offset/scroll" , "scroll" , function ( $ , win ) {
415- expect ( 24 ) ;
415+ expect ( 28 ) ;
416416
417417 // If we're going to bastardize the tests, let's just DO it
418418 var ie = / m s i e 8 / i. test ( navigator . userAgent ) ;
@@ -473,6 +473,17 @@ testIframe("offset/scroll", "scroll", function( $, win ) {
473473 notEqual ( $ ( ) . scrollLeft ( null ) , null , "jQuery().scrollLeft(null) testing setter on empty jquery object" ) ;
474474 strictEqual ( $ ( ) . scrollTop ( ) , null , "jQuery().scrollTop(100) testing setter on empty jquery object" ) ;
475475 strictEqual ( $ ( ) . scrollLeft ( ) , null , "jQuery().scrollLeft(100) testing setter on empty jquery object" ) ;
476+
477+ // Tests position after parent scrolling (#15239)
478+ $ ( "#scroll-1" ) . scrollTop ( 0 ) ;
479+ $ ( "#scroll-1" ) . scrollLeft ( 0 ) ;
480+ equal ( $ ( "#scroll-1-1" ) . position ( ) . top , 6 , "jQuery('#scroll-1-1').position().top unaffected by parent scrolling" ) ;
481+ equal ( $ ( "#scroll-1-1" ) . position ( ) . left , 6 , "jQuery('#scroll-1-1').position().left unaffected by parent scrolling" ) ;
482+
483+ $ ( "#scroll-1" ) . scrollTop ( 5 ) ;
484+ $ ( "#scroll-1" ) . scrollLeft ( 5 ) ;
485+ equal ( $ ( "#scroll-1-1" ) . position ( ) . top , 6 , "jQuery('#scroll-1-1').position().top unaffected by parent scrolling" ) ;
486+ equal ( $ ( "#scroll-1-1" ) . position ( ) . left , 6 , "jQuery('#scroll-1-1').position().left unaffected by parent scrolling" ) ;
476487} ) ;
477488
478489testIframe ( "offset/body" , "body" , function ( $ ) {
0 commit comments