Position Tests: Fix FF and IE10 test failures by accounting for subpixel offsets.(cherry picked from commit e12879a441)

This commit is contained in:
Mike Sherov 2013-03-31 12:28:40 -04:00 committed by Scott González
parent 3f29430f8a
commit d9391c7590

View File

@ -221,7 +221,9 @@ test( "of", function() {
}); });
test( "offsets", function() { test( "offsets", function() {
expect( 7 ); expect( 9 );
var offset;
$( "#elx" ).position({ $( "#elx" ).position({
my: "left top", my: "left top",
@ -261,7 +263,9 @@ test( "offsets", function() {
of: "#parentx", of: "#parentx",
collision: "none" collision: "none"
}); });
deepEqual( $( "#elx" ).offset(), { top: 65, left: 37 }, "decimal percentage offsets in my" ); offset = $( "#elx" ).offset();
equal( Math.round( offset.top ), 65, "decimal percentage offsets in my" );
equal( Math.round( offset.left ), 37, "decimal percentage offsets in my" );
$( "#elx" ).position({ $( "#elx" ).position({
my: "left+10.4 top-10.6", my: "left+10.4 top-10.6",
@ -269,7 +273,9 @@ test( "offsets", function() {
of: "#parentx", of: "#parentx",
collision: "none" collision: "none"
}); });
deepEqual( $( "#elx" ).offset(), { top: 49, left: 50 }, "decimal offsets in my" ); offset = $( "#elx" ).offset();
equal( Math.round( offset.top ), 49, "decimal offsets in my" );
equal( Math.round( offset.left ), 50, "decimal offsets in my" );
$( "#elx" ).position({ $( "#elx" ).position({
my: "left+right top-left", my: "left+right top-left",