Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixes #12139, make sure absolutely positioned elements have HTML as o…
…ffsetParent, closes gh-1010
- Loading branch information
1 parent
18e7a53
commit 8121309
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -469,7 +469,7 @@ test("chaining", function() { | ||
}); | ||
|
||
test("offsetParent", function(){ | ||
expect(12); | ||
expect(13); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mikesherov
Member
|
||
|
||
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() { | ||
We should encourage new tests to be in their own call to
test( ... )