<div id="bug-5280" style="height: 30px; width: 201px;">
<div style="width: 50px; height: 10px;"></div>
</div>
+
+ <div id="bug-8710-within-smaller" style="position: absolute; width: 100px; height: 99px; top: 0px; left: 0px; line-height: 99px;"></div>
+ <div id="bug-8710-within-bigger" style="position: absolute; width: 100px; height: 101px; top: 0px; left: 0px; line-height: 101px;"></div>
</div>
</body>
deepEqual( offset1, offset2 );
});
+test( "bug #8710: flip if flipped position fits more", function() {
+ expect( 3 );
+
+ // Positions a 10px tall element within 99px height at top 90px.
+ collisionTest({
+ within: "#bug-8710-within-smaller",
+ of: "#parentx",
+ collision: "flip",
+ at: "right bottom+30"
+ }, {
+ top: 0,
+ left: 60
+ }, "flip - top fits all" );
+
+ // Positions a 10px tall element within 99px height at top 92px.
+ collisionTest({
+ within: "#bug-8710-within-smaller",
+ of: "#parentx",
+ collision: "flip",
+ at: "right bottom+32"
+ }, {
+ top: -2,
+ left: 60
+ }, "flip - top fits more" );
+
+ // Positions a 10px tall element within 101px height at top 92px.
+ collisionTest({
+ within: "#bug-8710-within-bigger",
+ of: "#parentx",
+ collision: "flip",
+ at: "right bottom+32"
+ }, {
+ top: 92,
+ left: 60
+ }, "no flip - top fits less" );
+});
+
}( jQuery ) );