diff options
author | David Fox <dfox@snap-interactive.com> | 2012-10-26 12:38:05 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-10-26 12:40:57 -0400 |
commit | 8121309694630d3cb29e5b8dc4ad81527a5bb494 (patch) | |
tree | c3303642b9c9d19951249d92c2b1ab350aa7f54a /test/unit/offset.js | |
parent | 18e7a53d15dadae24703178a87192104935551b4 (diff) | |
download | jquery-8121309694630d3cb29e5b8dc4ad81527a5bb494.tar.gz jquery-8121309694630d3cb29e5b8dc4ad81527a5bb494.zip |
Fixes #12139, make sure absolutely positioned elements have HTML as offsetParent, closes gh-1010
Diffstat (limited to 'test/unit/offset.js')
-rw-r--r-- | test/unit/offset.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js index 8bca2d8c1..ac1cc0cbf 100644 --- a/test/unit/offset.js +++ b/test/unit/offset.js @@ -469,7 +469,7 @@ test("chaining", function() { }); test("offsetParent", function(){ - expect(12); + expect(13); var body = jQuery("body").offsetParent(); equal( body.length, 1, "Only one offsetParent found." ); @@ -496,6 +496,11 @@ test("offsetParent", function(){ var area = jQuery("#imgmap area").offsetParent(); equal( area[0], document.documentElement, "The html element is the offsetParent of the body." ); + + div = jQuery("<div>").css({ "position": "absolute" }).appendTo("body"); + equal( div.offsetParent()[0], document.documentElement, "Absolutely positioned div returns html as offset parent, see #12139" ); + + div.remove(); }); test("fractions (see #7730 and #7885)", function() { |