diff options
| author | mrmr1993 | 2014-12-29 11:26:30 +0000 |
|---|---|---|
| committer | mrmr1993 | 2014-12-29 11:26:30 +0000 |
| commit | a78d49c8a9cac57492f78a90246ce7695cf8e036 (patch) | |
| tree | bc1c79b24acd7136cfdae1c79aca0c059fdc2295 /content_scripts/link_hints.coffee | |
| parent | 278820f544d201b975a73ebe82d4a67792b967df (diff) | |
| download | vimium-a78d49c8a9cac57492f78a90246ce7695cf8e036.tar.bz2 | |
Add a comment clarifying why we no longer use XPath for link hints
Diffstat (limited to 'content_scripts/link_hints.coffee')
| -rw-r--r-- | content_scripts/link_hints.coffee | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 3a9e2027..b605c2ec 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -135,6 +135,11 @@ LinkHints = elements = document.documentElement.getElementsByTagName "*" visibleElements = [] + # The order of elements here is important; they should appear in the order they are in the DOM, so that + # we can work out which element is on top when multiple elements overlap. Detecting elements in this loop + # is the sensible, efficient way to ensure this happens. + # NOTE(mrmr1993): Our previous method (combined XPath and DOM traversal for jsaction) couldn't provide + # this, so it's necessary to check whether elements are clickable in order, as we do below. for element in elements tagName = element.tagName.toLowerCase() isClickable = false |
