Stream HTML into element or ShadowRoot - #12758
Open
noamr wants to merge 7 commits into
Open
Conversation
noamr
force-pushed
the
noamr/stream-html
branch
from
August 5, 2026 09:32
df24ea2 to
e416732
Compare
5 tasks
noamr
force-pushed
the
noamr/stream-html
branch
from
August 6, 2026 16:23
e416732 to
5106e9d
Compare
noamr
force-pushed
the
noamr/stream-html
branch
from
August 6, 2026 19:46
deb55bb to
e97c374
Compare
noamr
force-pushed
the
noamr/stream-html
branch
from
August 7, 2026 20:17
d5a18a7 to
b19b385
Compare
noamr
force-pushed
the
noamr/stream-html
branch
from
August 11, 2026 15:49
d87ab8d to
4880d38
Compare
noamr
force-pushed
the
noamr/stream-html
branch
from
August 11, 2026 20:18
2de75ec to
ce9f49b
Compare
noamr
added a commit
to web-platform-tests/wpt
that referenced
this pull request
Aug 12, 2026
See whatwg/html#12758 Note that tests that assert how this works with <template for> are still tentative as that PR is still not landed.
zcorpan
approved these changes
Aug 12, 2026
noamr
force-pushed
the
noamr/stream-html
branch
from
August 12, 2026 13:02
421aa3f to
043dcdf
Compare
noamr
force-pushed
the
noamr/stream-html
branch
from
August 12, 2026 13:25
043dcdf to
286c499
Compare
noamr
force-pushed
the
noamr/stream-html
branch
from
August 12, 2026 16:08
286c499 to
146266b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add streaming HTML insertion methods to Element, ShadowRoot, and ChildNode
Introduce safe and unsafe streaming HTML parsing and insertion methods:
This allows developers to parse and stream HTML directly into specific positions of the DOM tree using WritableStream.
The HTML fragment parser is divided into two:
DocumentFragmentThe preparation algorithm is used when streaming, by creating a new fragment parser, and then the stream is routed to feed that parser.
When parsing, the "insertion target redirection map" is configured to reroute insertions intended for the root to go directly into the stream's target element, instead of going into the
DocumentFragment.A special sanitizer mitigation is in place to avoid these removed elements from incurring side effects, by creating them in an inert document if they are about to be removed.
"Scripting mode" has been refactored so that the streaming fragment parser can execute scripts. Instead of relying on the fragment/inert/normal scripting mode, the parser receives a "target document" which is assigned to the script as an "intended document" and checked at preparation time. It is set to the dummy inert document for inert fragment parsing, and to the context document when
runScriptsis true.Closes #2142
streamHTMLtests web-platform-tests/wpt#61748(https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use.
(See WHATWG Working Mode: Changes for more details.)
💥 Error: Wattsi server error 💥
PR Preview failed to build. (Last tried on Aug 12, 2026, 4:09 PM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.
🔗 Related URL
Error output:
This seems to be an issue with the Wattsi Server service. PR Preview doesn't manage this service and so has no control over it. If you've identified an issue with it, you can report the issue to the maintainers of Wattsi Server directly. Please be courteous. Thank you!
If you don't have enough information above to solve the error by yourself or if the issue doesn't seem related to Wattsi Server, you can file an issue with PR Preview.