Commit 82ff4e2e authored by fat's avatar fat
Browse files

tooltip subpixel test fixes

parent 3b2418e6
Showing with 6 additions and 2 deletions
+6 -2
...@@ -332,7 +332,7 @@ $(function () { ...@@ -332,7 +332,7 @@ $(function () {
var tooltip = container.find('.tooltip') var tooltip = container.find('.tooltip')
start() 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() container.remove()
}, 100) }, 100)
}) })
...@@ -347,7 +347,11 @@ $(function () { ...@@ -347,7 +347,11 @@ $(function () {
.tooltip('show'), .tooltip('show'),
tooltip = container.find('.tooltip') 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') target.tooltip('hide')
}) })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment