1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 22:02:26 +01:00

Closes issue #396.

This commit is contained in:
Kris Maglione
2011-07-27 09:47:47 -04:00
parent fda9475c6e
commit 9c3e2b430d

View File

@@ -292,11 +292,15 @@ var HintSession = Class("HintSession", CommandMode, {
function isVisible(elem) { function isVisible(elem) {
let rect = elem.getBoundingClientRect(); let rect = elem.getBoundingClientRect();
if (!rect || !rect.width || !rect.height || if (!rect ||
rect.top > offsets.bottom || rect.bottom < offsets.top || rect.top > offsets.bottom || rect.bottom < offsets.top ||
rect.left > offsets.right || rect.right < offsets.left) rect.left > offsets.right || rect.right < offsets.left)
return false; return false;
if (!rect.width || !rect.height)
if (!Array.some(elem.childNodes, function (elem) util.computedStyle(elem).float != "none" && isVisible(elem)))
return false;
let computedStyle = doc.defaultView.getComputedStyle(elem, null); let computedStyle = doc.defaultView.getComputedStyle(elem, null);
if (computedStyle.visibility != "visible" || computedStyle.display == "none") if (computedStyle.visibility != "visible" || computedStyle.display == "none")
return false; return false;