The "real" tab elements are the rectangles to the left of the dotted vertical
lines. The triangle parts are made using the `::before` or `::after`
pseudo-elements of the tabs.
When calling `.elementFromPoint()` on a pseudo-element, its parent element is
returned. But calling `.getBoundingClientRect()` on the parent element returns a
rectangle only around the the parent element, excluding the pseudo-element.
Because of the pseudo-elements overlap the next tab, the second tab is
considered covered by the first tab.
Previously, a point to the right of the first tab would then be tried. But since
the pseudo-element isn't included in `.getBoundingClientRect()` that would mean
the point marked with a `+`, which is actually to the _left_ of the original
point, not to the right! That obviously didn't work.
With this commit, if the "try-right point" is to the left of the initial point
and the covering element and the queried element are in the same frame, the
point is tried again but this time forcing the element to be considered located
at that point, solving the issue.
Using pseudo-elements to create non-rectangular tabs is quite common, so this
will help on other sites as well.