Open xsc opened 8 years ago
I'm curious in general why is the event handler registered on document, which then traverses up to find href, and not just registered on every anchor tag?
@AlexWheeler @xsc see #27
@wavejumper Just out of curiosity (since I'm no longer on the project that was using pushy), are there any plans to fix those issues?
It seems that in some browsers (IE10/IE11 is where I saw it),
<img />
DOM elements have anhref
which represents the path portion of thesrc
URI, e.g.:Now, when pushy checks for
(.-href target)
(and only afterwards recurses throughtarget
's parents), it might pick up the image tag instead of the anchor in the following example:Note that, while
href
is present in both IE10's and IE11's image elements, I can only observe the problematic behaviour in IE10 (and even then only on some machines, so there might exist some patched versions - or another factor I haven't discovered yet).But, generally speaking, would it make sense to you to exclude image tags when checking for
href
? I'd be happy to supply a PR if desired.Have a nice day! Yannick