diff options
Diffstat (limited to 'common/content/hints.js')
-rw-r--r-- | common/content/hints.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/content/hints.js b/common/content/hints.js index a7d2b611..459ac88a 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -1077,12 +1077,18 @@ var Hints = Module("hints", { this.hintSession = HintSession(mode, opts); } }, { - isVisible: function isVisible(elem) { + isVisible: function isVisible(elem, offScreen) { let rect = elem.getBoundingClientRect(); if (!rect.width || !rect.height) if (!Array.some(elem.childNodes, function (elem) elem instanceof Element && util.computedStyle(elem).float != "none" && isVisible(elem))) return false; + let win = elem.ownerDocument.defaultView; + if (offScreen && (rect.top + win.scrollY < 0 || rect.left + win.scrollX < 0 || + rect.bottom + win.scrollY > win.scrolMaxY + win.innerHeight || + rect.right + win.scrollX > win.scrolMaxX + win.innerWidth)) + return false; + let computedStyle = util.computedStyle(elem, null); if (computedStyle.visibility != "visible" || computedStyle.display == "none") return false; |