diff --git a/common/content/hints.js b/common/content/hints.js index c263ae30..0e112c3b 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -131,13 +131,15 @@ function Hints() //{{{ let baseNodeAbsolute = util.xmlToDom(, doc); - let elem, tagname, text, span, rect; + let elem, tagname, text, span, rect, showtext; let res = buffer.evaluateXPath(hintMode.tags(), doc, null, true); let fragment = util.xmlToDom(
, doc); let start = pageHints.length; for (let elem in res) { + showtext = false; + // TODO: for iframes, this calculation is wrong rect = elem.getBoundingClientRect(); if (!rect || rect.top > height || rect.bottom < 0 || rect.left > width || rect.right < 0) @@ -152,14 +154,75 @@ function Hints() //{{{ continue; tagname = elem.localName.toLowerCase(); - if (tagname == "input" || tagname == "textarea") - text = elem.value; - else if (tagname == "select") + if (tagname == "input" || tagname == "select" || tagname == "textarea") { - if (elem.selectedIndex >= 0) - text = elem.item(elem.selectedIndex).text; + //TODO: Split this out somewhere... + // Always use the value + // Use the value if it is not numeric or label or name + // Never use the value, use label or name + //