Re: [whatwg/dom] Expose document fragment serialization algorithm (#965)

The sanitize API question moved (back) to https://github.com/WICG/sanitizer-api/issues/42.

With regards to OP, having considered the sanitization API more carefully, I don't think we should expose the serialization of a `DocumentFragment` directly (other than through `innerHTML`) as there is no context-free parse function that would give you back the `DocumentFragment` you serialized. The exception here is XML, but I don't think we should offer an API that ends up being problematic for all HTML users (which will be the majority).

(As a simple example, consider `obj.innerHTML = "<td>test<td>test"`. If `obj` is an HTML `body` element, it will contain a Text node "testtest". If it's an HTML `tr` element, it will end up containing what you expect.)

So I'll leave this open for a bit to see if there is a compelling counterargument, but I'm inclined to close this given the above.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/965#issuecomment-842852839

Received on Tuesday, 18 May 2021 05:30:34 UTC