Skip to content
Browse files
Fixes #12139, make sure absolutely positioned elements have HTML as o…
…ffsetParent, closes gh-1010
  • Loading branch information
David Fox authored and mikesherov committed Oct 26, 2012
1 parent 18e7a53 commit 8121309
Showing 1 changed file with 6 additions and 1 deletion.
@@ -469,7 +469,7 @@ test("chaining", function() {

test("offsetParent", function(){

This comment has been minimized.

Copy link

rwaldron Oct 26, 2012


We should encourage new tests to be in their own call to test( ... )

This comment has been minimized.

Copy link

mikesherov Oct 26, 2012


Had it that way first, but decided it belonged in the same test block. Next time we won't. Good to know. Thanks!

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" );


test("fractions (see #7730 and #7885)", function() {

0 comments on commit 8121309

Please sign in to comment.