Browser-local does not mean standards-complete
HTML parsing is error tolerant. Source diagnostics, sandboxed previews, and transformations do not replace full conformance, security, or production-browser testing.
Comments can carry build or legacy meaning
Compare input/output bytes and parsed structure before reusing the result. Conditional comments can be preserved by the native option; comment removal does not validate the rest of the document.
Parser and sanitizer boundary
HTML DOMParser creates a detached document and may repair or normalize markup. That is useful for inspection, but parsing alone does not sanitize untrusted HTML. Review scripts, inline event attributes, embedded content and application-specific URL/context rules before any live-DOM insertion.