Skip to content

Fix for broken events when event targets are SVGElementInstances (in Safari)#1970

Open
beckiechoi wants to merge 1 commit intoyui:dev-masterfrom
beckiechoi:svg-element-fix
Open

Fix for broken events when event targets are SVGElementInstances (in Safari)#1970
beckiechoi wants to merge 1 commit intoyui:dev-masterfrom
beckiechoi:svg-element-fix

Conversation

@beckiechoi
Copy link

W3 states that SVG element be a bit different from the rest of elements. They are a SVGElementInstance, and don't have attributes like nodeType, nodeName, parentNode, etc. A SVGElementInstance instead has a correspondingElement or both a correspondingElement and a correspondingUseElement(for <use/>). Both correspondingElementand correspondingUseElement have all the typical DOM node attributes that you'd expect from other elements.
(ref: http://www.w3.org/TR/SVG/struct.html#InterfaceSVGElementInstance)

Funnily enough, Chrome and Firefox do not follow this "standard", but Safari does.

Currently YUI doesn't have a support for it, making event targets to be null while attempting to wrap a SVGElementInstance into a Y.Node instance; hence this patch.

@yahoocla
Copy link

yahoocla commented Oct 9, 2014

CLA is valid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants