I want easy access to common namespace URIs #74
aarongustafson
started this conversation in
Wants
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Every time I author SVGs using JavaScript—without a library—I end up having to look up the SVG namespace URI (and others) to make sure that the elements I create behave properly. It seems like an enormous oversight that I can’t access the “http://www.w3.org/2000/svg” URI (or other equivalent XML namespace URIs) from, say, a static property on the SVGElement constructor or something. Instead I have look it up, or (if I’m feeling clever) find some way to trick the parser into handing me a properly constructed SVG element, all so the browser can see the magic 26 letters that will cause my paths to display.
Here’s an example of what I could do if the browser has a set of predefined constants available to use:
Here’s what that might look like if the namespace was defined on the element representation instead:
Please, please, create a common way that I can access these and other namespace constants directly in my scripts. I don’t have to look up the exact integers that represent WebGL constants and we successfully simplified the HTML doctype… I have confidence that we can make this happen.
https://webwewant.fyi/wants/5f7dc6381eb8b910287121e6/
Beta Was this translation helpful? Give feedback.
All reactions