Awesome! I was making exactly this library 13 years ago but only made it as far as creating CSS and other asset inlining+normalization tools before I ran into a few major roadblocks.<p>The most significant roadblock was that drawing SVG <foreignObject> with inline subresources (data: and blob: URIs) tainted canvases in Chrome and Safari, and this was partially resolved in 2019[1].<p>Notably, some issues still remain but apparently it's now workable. As is apparent from snapDOM, completely accurate CSS normalization is still an unsolved problem.<p>While I'm excited to see the HTML-in-foreignObject use case mature, it is also important to point out that the Media Capture API now has the ability to capture individual elements natively in Chrome[2].<p>1. <a href="https://issues.chromium.org/issues/41054640#comment49" rel="nofollow">https://issues.chromium.org/issues/41054640#comment49</a><p>2. <a href="https://developer.mozilla.org/en-US/docs/Web/API/CropTarget/fromElement_static" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/CropTarget/...</a>