@@ -829,7 +829,7 @@ describe('query', () => {
829829 } ) ;
830830 } ) ;
831831
832- describe ( 'containingParent ' , ( ) => {
832+ describe ( 'offsetParent ' , ( ) => {
833833 beforeEach ( ( ) => {
834834 document . body . innerHTML = '' ;
835835 } ) ;
@@ -842,10 +842,10 @@ describe('query', () => {
842842 ` ;
843843
844844 const $child = $ ( '#child' ) ;
845- const $containingParent = $child . containingParent ( ) ;
845+ const $offsetParent = $child . offsetParent ( ) ;
846846
847- expect ( $containingParent . length ) . toBe ( 1 ) ;
848- expect ( $containingParent [ 0 ] ) . toBe ( document . getElementById ( 'container' ) ) ;
847+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
848+ expect ( $offsetParent [ 0 ] ) . toBe ( document . getElementById ( 'container' ) ) ;
849849 } ) ;
850850
851851 it ( 'should find containing parent with transform' , ( ) => {
@@ -856,10 +856,10 @@ describe('query', () => {
856856 ` ;
857857
858858 const $child = $ ( '#child' ) ;
859- const $containingParent = $child . containingParent ( ) ;
859+ const $offsetParent = $child . offsetParent ( ) ;
860860
861- expect ( $containingParent . length ) . toBe ( 1 ) ;
862- expect ( $containingParent [ 0 ] ) . toBe ( document . getElementById ( 'transformed' ) ) ;
861+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
862+ expect ( $offsetParent [ 0 ] ) . toBe ( document . getElementById ( 'transformed' ) ) ;
863863 } ) ;
864864
865865 it ( 'should find containing parent with filter' , ( ) => {
@@ -870,10 +870,10 @@ describe('query', () => {
870870 ` ;
871871
872872 const $child = $ ( '#child' ) ;
873- const $containingParent = $child . containingParent ( ) ;
873+ const $offsetParent = $child . offsetParent ( ) ;
874874
875- expect ( $containingParent . length ) . toBe ( 1 ) ;
876- expect ( $containingParent [ 0 ] ) . toBe ( document . getElementById ( 'filtered' ) ) ;
875+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
876+ expect ( $offsetParent [ 0 ] ) . toBe ( document . getElementById ( 'filtered' ) ) ;
877877 } ) ;
878878
879879 it ( 'should find containing parent with contain property' , ( ) => {
@@ -884,10 +884,10 @@ describe('query', () => {
884884 ` ;
885885
886886 const $child = $ ( '#child' ) ;
887- const $containingParent = $child . containingParent ( ) ;
887+ const $offsetParent = $child . offsetParent ( ) ;
888888
889- expect ( $containingParent . length ) . toBe ( 1 ) ;
890- expect ( $containingParent [ 0 ] ) . toBe ( document . getElementById ( 'contained' ) ) ;
889+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
890+ expect ( $offsetParent [ 0 ] ) . toBe ( document . getElementById ( 'contained' ) ) ;
891891 } ) ;
892892
893893 it ( 'should find containing parent with will-change' , ( ) => {
@@ -898,10 +898,10 @@ describe('query', () => {
898898 ` ;
899899
900900 const $child = $ ( '#child' ) ;
901- const $containingParent = $child . containingParent ( ) ;
901+ const $offsetParent = $child . offsetParent ( ) ;
902902
903- expect ( $containingParent . length ) . toBe ( 1 ) ;
904- expect ( $containingParent [ 0 ] ) . toBe ( document . getElementById ( 'willchange' ) ) ;
903+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
904+ expect ( $offsetParent [ 0 ] ) . toBe ( document . getElementById ( 'willchange' ) ) ;
905905 } ) ;
906906
907907 it ( 'should return documentElement for fixed elements (null offsetParent fallback)' , ( ) => {
@@ -912,11 +912,11 @@ describe('query', () => {
912912 ` ;
913913
914914 const $fixed = $ ( '#fixed' ) ;
915- const $containingParent = $fixed . containingParent ( ) ;
915+ const $offsetParent = $fixed . offsetParent ( ) ;
916916
917917 // Fixed elements have null offsetParent, so should fallback to documentElement
918- expect ( $containingParent . length ) . toBe ( 1 ) ;
919- expect ( $containingParent [ 0 ] ) . toBe ( document . documentElement ) ;
918+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
919+ expect ( $offsetParent [ 0 ] ) . toBe ( document . documentElement ) ;
920920 } ) ;
921921
922922 it ( 'should return document.body when no containing parent found' , ( ) => {
@@ -929,10 +929,10 @@ describe('query', () => {
929929 ` ;
930930
931931 const $target = $ ( '#target' ) ;
932- const $containingParent = $target . containingParent ( ) ;
932+ const $offsetParent = $target . offsetParent ( ) ;
933933
934- expect ( $containingParent . length ) . toBe ( 1 ) ;
935- expect ( $containingParent [ 0 ] ) . toBe ( document . body ) ;
934+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
935+ expect ( $offsetParent [ 0 ] ) . toBe ( document . body ) ;
936936 } ) ;
937937
938938 it ( 'should use browser offsetParent when calculate is false' , ( ) => {
@@ -943,10 +943,10 @@ describe('query', () => {
943943 ` ;
944944
945945 const $child = $ ( '#child' ) ;
946- const $containingParent = $child . containingParent ( { calculate : false } ) ;
946+ const $offsetParent = $child . offsetParent ( { calculate : false } ) ;
947947
948- expect ( $containingParent . length ) . toBe ( 1 ) ;
949- expect ( $containingParent [ 0 ] ) . toBe ( document . getElementById ( 'child' ) . offsetParent ) ;
948+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
949+ expect ( $offsetParent [ 0 ] ) . toBe ( document . getElementById ( 'child' ) . offsetParent ) ;
950950 } ) ;
951951
952952 it ( 'should handle multiple elements' , ( ) => {
@@ -960,18 +960,18 @@ describe('query', () => {
960960 ` ;
961961
962962 const $items = $ ( '.item' ) ;
963- const $containingParents = $items . containingParent ( ) ;
963+ const $offsetParents = $items . offsetParent ( ) ;
964964
965- expect ( $containingParents . length ) . toBe ( 2 ) ;
966- expect ( $containingParents [ 0 ] ) . toBe ( document . getElementById ( 'container1' ) ) ;
967- expect ( $containingParents [ 1 ] ) . toBe ( document . getElementById ( 'container2' ) ) ;
965+ expect ( $offsetParents . length ) . toBe ( 2 ) ;
966+ expect ( $offsetParents [ 0 ] ) . toBe ( document . getElementById ( 'container1' ) ) ;
967+ expect ( $offsetParents [ 1 ] ) . toBe ( document . getElementById ( 'container2' ) ) ;
968968 } ) ;
969969
970970 it ( 'should handle empty selection' , ( ) => {
971971 const $empty = $ ( '.nonexistent' ) ;
972- const $containingParent = $empty . containingParent ( ) ;
972+ const $offsetParent = $empty . offsetParent ( ) ;
973973
974- expect ( $containingParent . length ) . toBe ( 0 ) ;
974+ expect ( $offsetParent . length ) . toBe ( 0 ) ;
975975 } ) ;
976976
977977 it ( 'should find nearest containing parent in nested contexts' , ( ) => {
@@ -986,11 +986,11 @@ describe('query', () => {
986986 ` ;
987987
988988 const $target = $ ( '#target' ) ;
989- const $containingParent = $target . containingParent ( ) ;
989+ const $offsetParent = $target . offsetParent ( ) ;
990990
991991 // Should find the immediate containing parent (inner), not the outer one
992- expect ( $containingParent . length ) . toBe ( 1 ) ;
993- expect ( $containingParent [ 0 ] ) . toBe ( document . getElementById ( 'inner' ) ) ;
992+ expect ( $offsetParent . length ) . toBe ( 1 ) ;
993+ expect ( $offsetParent [ 0 ] ) . toBe ( document . getElementById ( 'inner' ) ) ;
994994 } ) ;
995995 } ) ;
996996
0 commit comments