From 99ffe60fe28e015f379b697ef2499ecb2faeb958 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 28 Apr 2015 04:03:53 +0100 Subject: Make DomUtils.getVisibleClientRects default to expected behaviour This requires passing of an extra truthy argument in order to access the (generally) unexpected behaviour of sometimes returning the rects of child elements. All locations in the code that *actually* wanted this behaviour have been updated to continue using it. Also add a comment about the unexpected behaviour in the function description. --- content_scripts/link_hints.coffee | 2 +- content_scripts/vimium_frontend.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 51e5df35..3fa6f20f 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -197,7 +197,7 @@ LinkHints = isClickable = onlyHasTabIndex = true if isClickable - clientRect = DomUtils.getVisibleClientRect element + clientRect = DomUtils.getVisibleClientRect element, true if clientRect != null visibleElements.push {element: element, rect: clientRect, secondClassCitizen: onlyHasTabIndex} diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index e7aea163..967e1e1e 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -395,7 +395,7 @@ extend window, visibleInputs = for i in [0...resultSet.snapshotLength] by 1 element = resultSet.snapshotItem i - rect = DomUtils.getVisibleClientRect element + rect = DomUtils.getVisibleClientRect element, true continue if rect == null { element: element, rect: rect } -- cgit v1.2.3