There are new proposals coming for allow streaming HTML into an existing document. See whatwg/html#11542 and whatwg/html#2142 (comment).
For this to work, it would need to come along with sanitation support.
To connect the dots, trusted-types would need some form of sanitizing an HTML stream on the go, probably using a TransformStream.
This can have the following shape:policy.createHTMLTransformStream(), where the source of the untrusted HTML would be piped to the result's writable and the readable would be piped to the element receiving the markup.
There are new proposals coming for allow streaming HTML into an existing document. See whatwg/html#11542 and whatwg/html#2142 (comment).
For this to work, it would need to come along with sanitation support.
To connect the dots, trusted-types would need some form of sanitizing an HTML stream on the go, probably using a
TransformStream.This can have the following shape:
policy.createHTMLTransformStream(), where the source of the untrusted HTML would be piped to the result'swritableand thereadablewould be piped to the element receiving the markup.