Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$location causes JS errors on Chrome in conjunction with SVG #8118

Closed
eekboom opened this issue Jul 9, 2014 · 6 comments
Closed

$location causes JS errors on Chrome in conjunction with SVG #8118

eekboom opened this issue Jul 9, 2014 · 6 comments

Comments

@eekboom
Copy link

eekboom commented Jul 9, 2014

SVGElementInstances are created when you use "use" element in SVG to wrap the original element.
An SVGElementInstance has no "nodeName" property, which causes a click handler in the $locationProvider to fail.
SSCCE at http://plnkr.co/edit/HpiObOlF2MESe9OiRncW

See also disconnectme/disconnect#228

Other browsers seem to use the "use" element itself in event handling, so that the error does not happen there.
I am not really sure what the spec-compliant handling would be here, but it should be easy to work around in angular itself (for example using "correspondingUseElement" property).

@caitp
Copy link
Contributor

caitp commented Jul 9, 2014

ugh svg, causing so many problems =)

so I don't think we actually want the click handler to follow this link because the xlink:href is just linking to a different element, we want this to abort.

Would you care to submit a patch to fix this? It should be pretty simple (although I have said that before and turned out to be incorrect in the past)

@Narretz Narretz added this to the Backlog milestone Jul 9, 2014
@caitp caitp modified the milestones: 1.3.0-beta.15, Backlog Jul 9, 2014
@caitp
Copy link
Contributor

caitp commented Jul 9, 2014

You know what, I think we shouldn't worry about this, it looks like this has been fixed: https://src.chromium.org/viewvc/blink?revision=176090&view=revision

It's kind of a pain for the remaining months until people are using Chrome 37, but I guess it's ok

@caitp caitp closed this as completed Jul 9, 2014
@caitp
Copy link
Contributor

caitp commented Jul 9, 2014

/cc @IgorMinar unless you think we should accomodate buggy versions of chrome, in which case the workaround is pretty trivial

@eekboom
Copy link
Author

eekboom commented Jul 9, 2014

Ah, thanks for researching that!
That's fine with me: It doesn't really break anything for now and if it's fixed in the next Chrome version that's great!

@metamatt
Copy link
Contributor

This is still a problem for Safari, including Safari 8.

@uriklar
Copy link

uriklar commented Nov 20, 2014

Also for IE. See #10078

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants