-
Notifications
You must be signed in to change notification settings - Fork 160
Uncaught TypeError with SVG <use> elements. #124
Comments
Ah, All Nodes are supposed have a I was using that to know when to fire the |
Is there any workaround?
|
Actually it's more complicated, but possibly easier to understand. The I'm going to confer with someone more knowledgeable about Chrome's SVG to verify. |
The SVG <use> element has a horrifying "instance tree" related to ShadowDOM, but does not retarget. The SVGElementInstance (the instanceRoot type) has parts of a Node's API, but not all (like .contains). For native events the SVGElementInstance will bubble events up to the <use> element, even non-bubbling events like enter and leave, but it will not do so when dispatchEvent is called on it with a non-bubbling event. Only Safari, IE, and Chrome implement this monstrosity, and working group seems to agree it should be removed: http://lists.w3.org/Archives/Public/www-svg/2014Jan/0014.html This workaround rewites event.target and relatedTarget to refer to <use> elements and not their "instance trees". Fixes #124
When I hover over SVG elements I get this error: Object # has no method 'contains' pointerevents.dev.js:517
http://jsfiddle.net/VWw4T/ Only on chrome
The text was updated successfully, but these errors were encountered: