I had a hunch and the failing test I just commited (83e9ed9) proves it:
When using components to render children into a svg node, the children get the wrong namespace.
Looking at other frameworks, react and incremental-dom both rely on the parent element to determine which namespace to use for elements:
https://github.com/facebook/react/blob/master/src/renderers/dom/stack/client/ReactDOMComponent.js#L511-L533
https://github.com/google/incremental-dom/blob/master/src/nodes.js#L30-L40
Problem is that since we separated create from mount, we can’t really look at any parent at creation time. I think I also saw that some frameworks keep whitelists of svg tags, so that might be an option.
I had a hunch and the failing test I just commited (83e9ed9) proves it:
When using components to render children into a svg node, the children get the wrong namespace.
Looking at other frameworks, react and incremental-dom both rely on the parent element to determine which namespace to use for elements:
https://github.com/facebook/react/blob/master/src/renderers/dom/stack/client/ReactDOMComponent.js#L511-L533
https://github.com/google/incremental-dom/blob/master/src/nodes.js#L30-L40
Problem is that since we separated create from mount, we can’t really look at any parent at creation time. I think I also saw that some frameworks keep whitelists of svg tags, so that might be an option.