From: Daniel Carl Date: Wed, 23 Oct 2013 07:55:48 +0000 (+0200) Subject: Don't check element points for hinting. X-Git-Url: https://git.owens.tech/assets/favicon.png/assets/favicon.png/git?a=commitdiff_plain;h=5e0e53774fb65a6c93b82d84056d7934cb5cb861;p=vimb.git Don't check element points for hinting. The check if the upper left or center point of an element if that element is the element fails for various links with linebreaks. So the hinting was adapted to that what pentadactyl will show. --- diff --git a/src/hints.js b/src/hints.js index 1064541..55a79b5 100644 --- a/src/hints.js +++ b/src/hints.js @@ -39,16 +39,8 @@ var VbHint = (function(){ return false; } - var cStyle = win.getComputedStyle(e, null); - if (cStyle.display === "none" || cStyle.visibility !== "visible") { - return false; - } - - /* check if the element at the left top or center of current is the element self */ - /* else the element is covered by another element or within a hidden container */ - return e.childElementCount > 0 - || e.ownerDocument.elementFromPoint((rect.left + rect.right)/2, (rect.top + rect.bottom)/2) === e - || e.ownerDocument.elementFromPoint(rect.left, rect.top + rect.bottom) === e + var s = win.getComputedStyle(e, null); + return s.display !== "none" && s.visibility == "visible"; } var doc = win.document,