Comment

Comment by kyle-rb

>Using element.innerHTML is incorrect as SVG elements shouldn't have a innerHTML property

Is that definitely the case? Chrome, Firefox, and Safari all return a value for the innerHTML property of an element in an SVG document.

This W3C spec [0] specifically mentions XML documents in addition to HTML documents. And as I understand it, it seems like embedded SVG elements also inherit from the Element interface which includes InnerHTML.

IE11 might also be correct, following an older spec, but I don't think you can jump to the conclusion that Chrome is wrong just because the property is called innerHTML.

[0] https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin

parent kyle-rb 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton