Skip to content

Sanitizer API: HTML setter methods #1416

Open

Description

@jgraham

Description

This is an extension of the proposal in #1336 to cover the new HTML setters, and the integration with trusted types.

The Sanitizer API is providing a new method to modify HTML without causing XSS, which is one of the most prevalent security vulnerabilities in the world. In order for developers to be able to depend on these features it's necessary for them to be reliable cross-browser.

Note that, although this feature is an unmerged PR at the time of writing, we are confident it will be merged in plenty of time for Interop.

Specification

whatwg/html#12753
whatwg/html#12583

web-feature

html-setters

Test Links

Additional Signals

No response

Activity

  1. github-actions commented on Sep 18, 2026

    @github-actions

    This comment was automatically generated based on the information you provided. Please don't edit it.

    Below is additional information about the web feature (from the web-features project) which is referenced in your proposal.
    If this doesn't accurately correspond to your proposal, please update your initial comment to include web-features: <feature-id>.
    To find feature IDs, use the web-features explorer.

    Feature HTML setter methods

  2. changed the title [-]Sanitizer API: HTML (streaming) setter methods[/-] [+]Sanitizer API: HTML setter methods[/+] on Sep 21, 2026
  3. jgraham commented on Sep 21, 2026

    @jgraham
    ContributorAuthor

    Note: scope updated to exclude the streaming setter APIs.

  4. zcorpan commented on Sep 23, 2026

    @zcorpan
    Member

    Related: #1465

  5. engedy commented on Sep 23, 2026

    @engedy
  6. jakearchibald commented on Sep 29, 2026

    @jakearchibald
    Contributor

    Dupe of #1336? You can't really use one without the other.

  7. tunetheweb commented on Sep 29, 2026

    @tunetheweb

    Dupe of #1336? You can't really use one without the other.

    Well you can implement Sanitizer API with just setHTML (Firefox does this, as did Chrome originally, but we're about to launch these), without these new additions. So while I agree #1336 is needed first, I don't think implementing #1336 implies this will be implemented as well.

    The original post does start with "This is an extension of the proposal in #1336..."

    So currently we're tracking these as two separate feature ids: sanitizer and html-setters (three if you include html-streaming-setters). So I think it's not unreasonable to track as two (very related!) interop proposals. While I'd love to see both implemented, I don't know if combining them them would risk #1336 getting rejected due to the scope being too big/these being too new, if these are insisted upon being part of that?

  8. jakearchibald commented on Sep 29, 2026

    @jakearchibald
    Contributor

    I'm not against them staying separate as long as it's absolutely clear what it would mean for Interop to take on one but not the other.

  9. jakearchibald commented on Oct 5, 2026

    @jakearchibald
    Contributor

    @jgraham could you edit the OP to remove references to streaming stuff?

    Then it's:

  10. zcorpan commented on Nov 6, 2026

    @zcorpan
    Member

    I added whatwg/html#12583 to OP for the trusted types integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    focus-area-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions