Stop link hints from overlapping and detect clickable elements on google inbox

This PR
* rewrites the link hints XPath as DOM code, giving better accuracy and readability
* detects overlapping clickable elements and attempts to find locations where they do not overlap to place a link hint
  - this requires elements to be in the order they appear in the DOM, another reason for using the DOM rather than an XPath
* integrates a variation on PR #1316 to detect clickable elements on google inbox
* allows for multiple images to use the same `<map>` to provide clickable regions
* add support for `<area shape="circle">` in image maps (previously the code assumed everything was a rectangle)
* document the fact that we don't properly support `<area shape="poly">` in image maps
* support clicking `opacity: 0` elements: some websites (notably Facebook) use these to provide the functionality of less attractive elements (eg. `<input type="file">`) while showing an image behind that appears to the user to be the actual button.

This fixes #1307.

Edit: also
* doesn't create link hints for off-screen image maps.
Haven't tried it yet, bit for it perform as well as the existing impl on
heavy link sites like reddit?
On Dec 18, 2014 8:51 AM, "Matthew Ryan" <notifications@github.com> wrote:

> In content_scripts/link_hints.coffee
> <https://github.com/philc/vimium/pull/1355#discussion-diff-22054156>:
>
> > +    #
> > +    # Remove rects from elements where another clickable element lies above it.
> > +    nonOverlappingElements = []
> > +    visibleElements = visibleElements.reverse()
> > +    while visibleElement = visibleElements.pop()
> > +      rects = [visibleElement.rect]
> > +      for {rect: negativeRect} in visibleElements
> > +        rects = Array::concat.apply [], (rects.map (rect) -> Utils.subtractRect rect, negativeRect)
> > +      if rects.length > 0
> > +        nonOverlappingElements.push {element: visibleElement.element, rect: rects[0]}
> > +      else
> > +        # Every part of the element is covered by some other element, so just insert the whole element's
> > +        # rect.
> > +        # TODO(mrmr1993): This is probably the wrong thing to do, but we don't want to stop being able to
> > +        # click some elements that we could click before.
> > +        nonOverlappingElements.push visibleElement
>
> I've been trying without this, and I think that if this pushes to master
> (or post-1.46), this needs to stay in.
>
> On The Old Reader <http://theoldreader.com>, the entire sidebar is
> covered with clickable elements (so all rects are excluded) but the sidebar
> can also be activated by tabindex to scroll. Clearly we ought to have a
> link hint for the sidebar, but there's nowhere for it left to go once we've
> excluded all the clickable elements. I like being able to scroll, so I'm
> all for leaving this enabled for tricky cases like this.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/philc/vimium/pull/1355/files#r22054156>.
>