aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/offset.js
diff options
context:
space:
mode:
authorLiam James <liam@minimaximize.com>2024-04-19 23:47:52 +1000
committerGitHub <noreply@github.com>2024-04-19 15:47:52 +0200
commit556eaf4a193287c306d163635cbb5f5c95a22a84 (patch)
treed8f8c91307f28c32db5a5c0d9b5ba6ce0a833a4c /test/unit/offset.js
parentdf1df9503afad78bec3ba5217f9a9efce49fe634 (diff)
downloadjquery-556eaf4a193287c306d163635cbb5f5c95a22a84.tar.gz
jquery-556eaf4a193287c306d163635cbb5f5c95a22a84.zip
Offset: Increase search depth when finding the 'real' offset parent
Changes: * Increase search depth when finding for the real offset parent * Ignore offset for statically positioned offset parent * Add tests for the position of an element in a table Closes gh-4861
Diffstat (limited to 'test/unit/offset.js')
-rw-r--r--test/unit/offset.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index 73ec8928f..50eee3dd5 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -436,13 +436,16 @@ testIframe( "fixed", "offset/fixed.html", function( assert, $, window ) {
} );
testIframe( "table", "offset/table.html", function( assert, $ ) {
- assert.expect( 4 );
+ assert.expect( 6 );
assert.equal( $( "#table-1" ).offset().top, 6, "jQuery('#table-1').offset().top" );
assert.equal( $( "#table-1" ).offset().left, 6, "jQuery('#table-1').offset().left" );
assert.equal( $( "#th-1" ).offset().top, 10, "jQuery('#th-1').offset().top" );
assert.equal( $( "#th-1" ).offset().left, 10, "jQuery('#th-1').offset().left" );
+
+ assert.equal( $( "#th-1" ).position().top, 10, "jQuery('#th-1').position().top" );
+ assert.equal( $( "#th-1" ).position().left, 10, "jQuery('#th-1').position().left" );
} );
testIframe( "scroll", "offset/scroll.html", function( assert, $, win ) {