diff options
| author | int3 | 2010-04-25 23:19:48 +0800 |
|---|---|---|
| committer | Phil Crosby | 2010-05-01 21:14:53 -0700 |
| commit | 9123deb1569dfc0335ae8e74d17d4e0667af45a2 (patch) | |
| tree | c13237e3b631b48832216b989753e476ce28584b | |
| parent | 0e52859aa306692036232e6e161a99083341931f (diff) | |
| download | vimium-9123deb1569dfc0335ae8e74d17d4e0667af45a2.tar.bz2 | |
Ensure getComputedStyle is only called on element nodes
| -rw-r--r-- | linkHints.js | 6 |
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; } + } } } |
