aboutsummaryrefslogtreecommitdiffstats
path: root/linkHints.js
diff options
context:
space:
mode:
authorint32010-04-25 23:19:48 +0800
committerPhil Crosby2010-05-01 21:14:53 -0700
commit9123deb1569dfc0335ae8e74d17d4e0667af45a2 (patch)
treec13237e3b631b48832216b989753e476ce28584b /linkHints.js
parent0e52859aa306692036232e6e161a99083341931f (diff)
downloadvimium-9123deb1569dfc0335ae8e74d17d4e0667af45a2.tar.bz2
Ensure getComputedStyle is only called on element nodes
Diffstat (limited to 'linkHints.js')
-rw-r--r--linkHints.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/linkHints.js b/linkHints.js
index 5f3d608f..daedb7d6 100644
--- a/linkHints.js
+++ b/linkHints.js
@@ -96,11 +96,17 @@ function getVisibleClickableElements() {
// but floated elements. Check for this.
if (boundingRect.width == 0 && boundingRect.height == 0) {
for (var j = 0; j < element.childNodes.length; j++) {
+
+ // check that the node is an element node
+ if (element.childNodes[j].nodeType != 1) // nodeType 1: ELEMENT_NODE
+ continue;
+
if (window.getComputedStyle(element.childNodes[j], null).getPropertyValue('float') != 'none'
&& isVisible(element.childNodes[j])) {
visibleElements.push(element.childNodes[j]);
break;
}
+
}
}
}