From: fat Date: Thu, 16 Jan 2014 22:25:28 +0000 (-0800) Subject: tooltip subpixel test fixes X-Git-Tag: v3.1.0~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82ff4e2e40a3f81c569cc46c1ae1f10ffde9e6ad;p=thirdparty%2Fbootstrap.git tooltip subpixel test fixes --- diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index fa1ad57fe3..087de80dd9 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -332,7 +332,7 @@ $(function () { var tooltip = container.find('.tooltip') start() - ok(tooltip.offset().top + tooltip.outerHeight() <= tooltiped.offset().top) + ok(Math.round(tooltip.offset().top + tooltip.outerHeight()) <= Math.round(tooltiped.offset().top) container.remove() }, 100) }) @@ -347,7 +347,11 @@ $(function () { .tooltip('show'), tooltip = container.find('.tooltip') - ok( Math.round(target.offset().top + (target[0].offsetHeight / 2) - (tooltip[0].offsetHeight / 2)) === Math.round(tooltip.offset().top) ) + // this is some dumb hack shit because sub pixels in firefox + var top = Math.round(target.offset().top + (target[0].offsetHeight / 2) - (tooltip[0].offsetHeight / 2)) + var top2 = Math.round(tooltip.offset().top) + var topDiff = top - top2 + ok(topDiff <= 1 && topDiff >= -1) target.tooltip('hide') })