From f2bce0b1152da1cc9b22fc8ce8313f1757cca329 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 24 Aug 2008 23:10:07 +0000 Subject: [PATCH] ignore hintable elements which are not displayed (Krishna Rajendran) --- content/hints.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/hints.js b/content/hints.js index 2320dea5..1237b90b 100644 --- a/content/hints.js +++ b/content/hints.js @@ -107,6 +107,10 @@ liberator.Hints = function () //{{{ if (!rect) continue; + var computedStyle = doc.defaultView.getComputedStyle(elem, null); + if (computedStyle.getPropertyValue("visibility") == "hidden" || computedStyle.getPropertyValue("display") == "none") + continue; + // TODO: mozilla docs recommend localName instead of tagName tagname = elem.tagName.toLowerCase(); if (tagname == "input" || tagname == "textarea")