elm-community / typed-svg

Typed SVG library written for Elm
BSD 3-Clause "New" or "Revised" License
59 stars 16 forks source link

Should SVG namespace property be "namespace" #3

Open rupertlssmith opened 7 years ago

rupertlssmith commented 7 years ago

The SVG namespace is defined as:

svgNamespace : Attribute msg svgNamespace = VirtualDom.property "namespace" (Json.string "http://www.w3.org/2000/svg")

Should the "namespace" property actually be "xmlns"? As described here:

https://developer.mozilla.org/en/docs/Web/SVG/Namespaces_Crash_Course

canadaduane commented 7 years ago

Interesting! I don't know where the original namespace property comes from. That's copied from the elm-lang/svg package. I'm surprised that it would be wrong. I agree though that based on the spec (and if I understand the intent of svgNamespace) it seems like xmlns is preferred. It's also strange to me that each node is using the svgNamespace attribute... that seems unnecessary (since namespaces, once declared, are used as the default for all inner scope elements).