aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dom_tests
diff options
context:
space:
mode:
authorStanley Shyiko2013-10-28 22:13:37 +0200
committerStanley Shyiko2013-10-28 22:13:37 +0200
commit88cbe89247a4ebdf9498d77eb0f7e675b7a4c785 (patch)
tree477890b727fa2f2c5dadf6b01caac08363e56e99 /tests/dom_tests
parent610ce8aaab164ace9f60d83773b382f4d7978140 (diff)
downloadvimium-88cbe89247a4ebdf9498d77eb0f7e675b7a4c785.tar.bz2
Fixed detection of links which are only partially inside the viewport
Diffstat (limited to 'tests/dom_tests')
-rw-r--r--tests/dom_tests/dom_utils_test.coffee8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/dom_tests/dom_utils_test.coffee b/tests/dom_tests/dom_utils_test.coffee
index d0f881ba..130a3014 100644
--- a/tests/dom_tests/dom_utils_test.coffee
+++ b/tests/dom_tests/dom_utils_test.coffee
@@ -42,6 +42,14 @@ context "Check visibility",
assert.equal null, DomUtils.getVisibleClientRect document.getElementById 'foo'
assert.equal null, DomUtils.getVisibleClientRect document.getElementById 'bar'
+ should "detect links only partially outside viewport as visible", ->
+ document.getElementById("test-div").innerHTML = """
+ <a id='foo' style='position:absolute;top:-10px'>test</a>
+ <a id='bar' style='position:absolute;left:-10px'>test</a>
+ """
+ assert.isTrue (DomUtils.getVisibleClientRect document.getElementById 'foo') != null
+ assert.isTrue (DomUtils.getVisibleClientRect document.getElementById 'bar') != null
+
should "detect opacity:0 links as hidden", ->
document.getElementById("test-div").innerHTML = """
<a id='foo' style='opacity:0'>test</a>