1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 06:27:59 +01:00

Re-enable Text Edit mode in non-Google editable windows.

This commit is contained in:
Kris Maglione
2011-08-06 15:56:16 -04:00
parent ff0c5af5db
commit 85dfd5becd
3 changed files with 35 additions and 27 deletions

View File

@@ -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;