aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/offset.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index cfa14449b..1f8c3b15c 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -422,6 +422,32 @@ test("offsetParent", function(){
equals( div[1], jQuery("#nothiddendiv")[0], "The div is the offsetParent." );
});
+test("fractions (see #7730 and #7885)", function() {
+ expect(2);
+
+ jQuery('body').append('<div id="fractions"/>');
+
+ var expected = { top: 1000, left: 1000 };
+ var div = jQuery('#fractions');
+
+ div.css({
+ position: 'absolute',
+ left: '1000.7432222px',
+ top: '1000.532325px',
+ width: 100,
+ height: 100
+ });
+
+ div.offset(expected);
+
+ var result = div.offset();
+
+ equals( result.top, expected.top, "Check top" );
+ equals( result.left, expected.left, "Check left" );
+
+ div.remove();
+});
+
function testoffset(name, fn) {
test(name, function() {