4 ms·
That xml namespace is a significant portion of the total. At least for inline svg you don't need it. Btw-- what is the history of inline svg not needing an xml
by jancsika 9y ago
That xml namespace is a significant portion of the total. At least for inline svg you don't need it.
Btw-- what is the history of inline svg not needing an xml namespace in HTML5?
- ygra 9y agoLikely the requirement to be handled by a non-XML parser and to ease adoption. In practice the namespace will always be copied from somewhere because no one ever types it from memory. Still, IMHO inline SVG is a horrible mess as it is parsed as sort-of XML, has its own weird rules, doesn't show up as written in the DOM Explorer, and breaks on completely strange "errors" like not naming the XLink namespace prefix "xlink". Can I still wish for XHTML?
- jrochkind1 9y agoHTML5 is not xml-based, and does not require or use xml namespaces anywhere, I think?
- xg15 9y agoFrom what I read, it goes back to the HTML5 vs XHTML disputes. I think the story was something like this: One of the proposed advantages of XHTML was the plan that at some point you'd be able to embed other XML dialects into XHTML - such as SVG. HTML5 is famously not XML or SGML but a grammar of its own - and the ability to embed other languages was consciously dropped. However, the use-case of defining SVG images inline was considered important enough that it should be kept. How to do so if HTML5 is not even XML? Just make a special exception for SVG and declare xml-that's-a-valid-svg a part of the HTML grammar. Because it's a special case built into the language, there is no need for generic namespace declarations like in XML - so they can be dropped.