Closed brianmhunt closed 6 years ago
@mbest Do you know anything about this sort of thing?
I don't think Knockout has ever supported templates within an <svg>
element so we haven't had to deal with this.
Looks like this is well documented here: https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course
Some nodes require
document.createElementNS
.We always respect the
xmlns
attribute, and then wield it appropriately i.e. changejsxToNode
to:We also need to use
setAttributeNS
,removeAttributeNS
, andgetAttributeNS
.To reduce the amount of repetition of the
xmlns
attribute we could also keep track of thexmlns
for nodes where a parent element hasxmlns
set.It looks like the only NS we need to track is http://www.w3.org/2000/svg, and we could do that automatically when we encounter the
<svg>
tag.Thanks @ctcarton for pointing this out.