]> source.dussan.org Git - jquery.git/commitdiff
Offset: allow small differences in offset.top
authorJoelle Fleurantin <joasqueeniebee@gmail.com>
Sun, 18 Oct 2015 16:45:41 +0000 (12:45 -0400)
committerDave Methvin <dave.methvin@gmail.com>
Sun, 18 Oct 2015 20:07:29 +0000 (16:07 -0400)
Fixes gh-2590
(cherry picked from commit 9f9e204bba41b7a9cde5ba7e065d817ef8b18c41)

test/unit/offset.js

index 76b2e897ed20c459e5e529ae347d76bdfb1b2d53..25f747b49853531ebd7e40b729228b235497f1c6 100644 (file)
@@ -566,7 +566,9 @@ QUnit.test( "fractions (see #7730 and #7885)", function( assert ) {
 
        result = div.offset();
 
-       assert.equal( result.top, expected.top, "Check top" );
+       // Support: Chrome 45-46+
+       // In recent Chrome these values differ a little.
+       assert.ok( Math.abs( result.top - expected.top ) < 0.25, "Check top within 0.25 of expected" );
        assert.equal( result.left, expected.left, "Check left" );
 
        div.remove();