From 5e0e53774fb65a6c93b82d84056d7934cb5cb861 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Wed, 23 Oct 2013 09:55:48 +0200 Subject: [PATCH] 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. --- src/hints.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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, -- 2.20.1