Skip to content

Add new HTML setters and streamers - #30328

Merged
Elchi3 merged 9 commits into
mdn:mainfrom
tunetheweb:html-setters
Sep 1, 2026
Merged

Elchi3 merged 9 commits into
mdn:mainfrom
tunetheweb:html-setters

Conversation

@tunetheweb

@tunetheweb tunetheweb commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Chrome 148 shipped the new HTML setters and streaming APIs behind a flag, and we're planning on releasing them unflagged from Chrome 154:
https://developer.chrome.com/blog/declarative-partial-updates#renewed_html_insertion_and_streaming_methods

I'd like to start adding them to BCD in prep for that, and also to kick off the web features PR.

At the moment I've marked most of them as "standard_track": false even though they are going through standardisation because we don't have spec links yet. Will update those when whatwg/html#12758 lands.

I've also corrected setHTMLUnsafe support of options.sanitizer which was included in Chrome 146 (tests showing this). Looks like this was updated incorrectly in #28302

Test results and supporting details

https://wpt.fyi/results/domparsing/tentative?label=experimental&label=master&aligned

https://chromestatus.com/feature/5054329641893888

Related issues

Web Feature Issue (WIP): web-platform-dx/web-features#4117

@github-actions github-actions Bot added the data:api Compatibility data for Web API features. https://developer.mozilla.org/docs/Web/API label Aug 25, 2026
@github-actions github-actions Bot added the size:xl Pull request changing more than 1,000 lines of code. label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@Elchi3

Elchi3 commented Aug 26, 2026

Copy link
Copy Markdown
Member

Do you happen to have an IDL snippet for these things?

@tunetheweb

Copy link
Copy Markdown
Contributor Author

Check out here: https://github.com/WICG/declarative-partial-updates/blob/main/dynamic-markup-revamped-explainer.md#resulting-api
Though as I was raising this, I noticed (and corrected) a few of these.

They're also in the PR, btu the preview isn't working and it's really difficult to read those without that :-(
whatwg/html#12758

@noamr do you have a link to the Chromium source code IDLs that Chrome uses which should be more accurate?

@noamr

noamr commented Aug 26, 2026

Copy link
Copy Markdown

Check out here: https://github.com/WICG/declarative-partial-updates/blob/main/dynamic-markup-revamped-explainer.md#resulting-api Though as I was raising this, I noticed (and corrected) a few of these.

They're also in the PR, btu the preview isn't working and it's really difficult to read those without that :-( whatwg/html#12758

@noamr do you have a link to the Chromium source code IDLs that Chrome uses which should be more accurate?

It's working now:
https://whatpr.org/html/12758/dynamic-markup-insertion.html#dom-parsing-and-serialization

@Elchi3

Elchi3 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Thanks, that IDL snipped alone doesn't compile, it also needs https://pr-preview.s3.amazonaws.com/w3c/trusted-types/pull/606.html#trusted-parser-options which is missing from this PR.

@Elchi3

Elchi3 commented Aug 27, 2026

Copy link
Copy Markdown
Member

You're also missing streamReplaceWithHTML and streamReplaceWithHTMLUnsafe in Element.
As well as all new features in CharacterData and DocumentType.

(I'm currently working on flag support for the Collector. I can generate PRs like this which will reduce these kinds of errors in the future.)

@tunetheweb

Copy link
Copy Markdown
Contributor Author

You're also missing streamReplaceWithHTML and streamReplaceWithHTMLUnsafe in Element.

Added!

As well as all new features in CharacterData and DocumentType.

Can you or @noamr point me to what/where they are?

(I'm currently working on flag support for the Collector. I can generate PRs like this which will reduce these kinds of errors in the future.)

Oh that'll be nice! Obviously automation is best, but waiting until it's shipped unflagged is quite late when people wanna see compat data before then.

@Elchi3

Elchi3 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Can you or @noamr point me to what/where they are?

Everything that is under partial interface mixin ChildNode which is included by these interfaces:

DocumentType includes ChildNode;
Element includes ChildNode;
CharacterData includes ChildNode;

@Elchi3

Elchi3 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Oh that'll be nice! Obviously automation is best, but waiting until it's shipped unflagged is quite late when people wanna see compat data before then.

Yes, once I have implemented support for flags I will play with running updates against BCD, so that the data is available before things ship. Soon!™ :)

@tunetheweb

Copy link
Copy Markdown
Contributor Author

OK think I've added that correctly now.

@Elchi3

Elchi3 commented Aug 28, 2026

Copy link
Copy Markdown
Member

This still misses additions to DocumentType:

api.DocumentType.afterHTML
api.DocumentType.afterHTMLUnsafe
api.DocumentType.beforeHTML
api.DocumentType.beforeHTMLUnsafe
api.DocumentType.replaceWithHTML
api.DocumentType.replaceWithHTMLUnsafe
api.DocumentType.streamAfterHTML
api.DocumentType.streamAfterHTMLUnsafe
api.DocumentType.streamBeforeHTML
api.DocumentType.streamBeforeHTMLUnsafe
api.DocumentType.streamReplaceWithHTML
api.DocumentType.streamReplaceWithHTMLUnsafe

@tunetheweb

Copy link
Copy Markdown
Contributor Author

Urgh I incorrectly added to Document instead of DocumentType. Have moved it now.

@Elchi3 Elchi3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tunetheweb 👍

@Elchi3
Elchi3 merged commit e0b6e66 into mdn:main Sep 1, 2026
10 checks passed
@mdn-bot mdn-bot mentioned this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compatibility data for Web API features. https://developer.mozilla.org/docs/Web/API size:xl Pull request changing more than 1,000 lines of code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants