4 ms·
Bear in mind that SVGs CAN be embedded within HTML so you can have ``` <p> <svg><circle></svg> Some content <svg><rectangle></svg> </p> ``` These elem
by eithed 4y ago
Bear in mind that SVGs CAN be embedded within HTML so you can have
```
<p>
<svg><circle></svg>
Some content
<svg><rectangle></svg>
</p>
```
These elements are valid parts of DOM and the events on them trigger within scope of HTML DOM and not within scope of SVG DOM
- pcthrowaway 4y agoI'm confused by this comment, because I'm not sure how else they would be included in a webpage
- itslennysfault 4y agoNot sure what they meant, but my only guess is they mean via an img tag. <img src="some.svg">
- pcthrowaway 4y agoDerp.. I've been rendering svgs in JSX for so long, I forgot about the obvious things like <img>, <link>, even adding an svg in CSS with background-image
- eithed 4y agoYup. You can also do <svg src="some.svg"/> But I was talking about embedding which is, I think much nicer. The only difference between both cases I was able to find is that if SVG is loaded via src, it will be a separate `document`. If it's embedded, it's part of DOM tree of HTML document that is being viewed.
- Sephr 4y agoLikewise, SVGs can embed HTML with <foreignObject>. It's DOM trees all the way down
- AndrewSwift 4y agoSvija SVG's are embedded in HTML — it's necessary to get the page to resize correctly. We would like to integrate HTML elements wherever possible to display text. This would enable us to preserve semantic content, make accessibility easier, and make text management easier. The problem is that until we have funding to build our own page editor it's just not feasible. Svija is meant for designers, not coders.