youtube / spfjs

A lightweight JS framework for fast navigation and page updates from YouTube
https://youtube.github.io/spfjs/
MIT License
2.23k stars 147 forks source link

Add check for use element in getAncestorWithHref_ #423

Open gilleard opened 8 years ago

gilleard commented 8 years ago

If you're using the xlink:href attribute for external svgs, like this:

<a class="spf-link" href="/"><svg><use xlink:href="sprite.svg#logo"></use></svg></a>

Then during clicks nav.getAncestorWithHref_ will return the use element, causing an error later on when assuming the href attribute is a string.

I've used css pointer-events to avoid the problem in my project but wanted to flag the issue.