diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2016-02-09 00:14:19 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2016-02-09 00:14:19 +0300 |
commit | ee0f61647cb93d587764280b1278807d9ff86fc9 (patch) | |
tree | 7db39977229c055ac8d3768ff61aa28378542f15 /test | |
parent | 412c5dfb0d6301dc0b3d7c98325cc9908dd97511 (diff) | |
download | jquery-ee0f61647cb93d587764280b1278807d9ff86fc9.tar.gz jquery-ee0f61647cb93d587764280b1278807d9ff86fc9.zip |
Revert "Offset: account for scroll when calculating position"
This reverts commit 2d715940b9b6fdeed005cd006c8bf63951cf7fb2.
This commit provoked new issues: gh-2836, gh-2828.
At the meeting, we decided to revert offending commit
(in all three branches - 2.2-stable, 1.12-stable and master)
and tackle this issue in 3.x.
Fixes gh-2828
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/offset.js | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js index 5100dbf34..cacfe6750 100644 --- a/test/unit/offset.js +++ b/test/unit/offset.js @@ -415,7 +415,7 @@ testIframe( "offset/table", "table", function( $, window, document, assert ) { } ); testIframe( "offset/scroll", "scroll", function( $, win, doc, assert ) { - assert.expect( 28 ); + assert.expect( 24 ); assert.equal( $( "#scroll-1" ).offset().top, 7, "jQuery('#scroll-1').offset().top" ); assert.equal( $( "#scroll-1" ).offset().left, 7, "jQuery('#scroll-1').offset().left" ); @@ -487,17 +487,6 @@ testIframe( "offset/scroll", "scroll", function( $, win, doc, assert ) { assert.notEqual( $().scrollLeft( null ), null, "jQuery().scrollLeft(null) testing setter on empty jquery object" ); assert.strictEqual( $().scrollTop(), undefined, "jQuery().scrollTop() testing getter on empty jquery object" ); assert.strictEqual( $().scrollLeft(), undefined, "jQuery().scrollLeft() testing getter on empty jquery object" ); - - // Tests position after parent scrolling (#15239) - $( "#scroll-1" ).scrollTop( 0 ); - $( "#scroll-1" ).scrollLeft( 0 ); - assert.equal( $( "#scroll-1-1" ).position().top, 6, "jQuery('#scroll-1-1').position().top unaffected by parent scrolling" ); - assert.equal( $( "#scroll-1-1" ).position().left, 6, "jQuery('#scroll-1-1').position().left unaffected by parent scrolling" ); - - $( "#scroll-1" ).scrollTop( 5 ); - $( "#scroll-1" ).scrollLeft( 5 ); - assert.equal( $( "#scroll-1-1" ).position().top, 6, "jQuery('#scroll-1-1').position().top unaffected by parent scrolling" ); - assert.equal( $( "#scroll-1-1" ).position().left, 6, "jQuery('#scroll-1-1').position().left unaffected by parent scrolling" ); } ); testIframe( "offset/body", "body", function( $, window, document, assert ) { @@ -511,6 +500,7 @@ testIframe( "offset/body", "body", function( $, window, document, assert ) { QUnit.test( "chaining", function( assert ) { assert.expect( 3 ); + var coords = { "top": 1, "left": 1 }; assert.equal( jQuery("#absolute-1").offset(coords).selector, "#absolute-1", "offset(coords) returns jQuery object" ); assert.equal( jQuery("#non-existent").offset(coords).selector, "#non-existent", "offset(coords) with empty jQuery set returns jQuery object" ); |