Skip to content

add(considered): Sanitizer API is too narrow for a standalone spec page - #208

Merged
jdevalk merged 3 commits into
mainfrom
considered/sanitizer-api-2026-09-10
Sep 11, 2026
Merged

jdevalk merged 3 commits into
mainfrom
considered/sanitizer-api-2026-09-10

Conversation

@jdevalk

@jdevalk jdevalk commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Records the Sanitizer API as too-narrow for a standalone spec page. Preventing HTML injection is a website outcome worth specifying; requiring a particular sanitiser is an implementation choice.

The entry acknowledges that setHTML() already ships in Chrome and Firefox. Safari support is a compatibility constraint requiring feature detection and a suitable fallback, not the reason to defer a spec page.

The revisit criterion is a broader page on preventing HTML injection, with outcome-based verification and the Sanitizer API as a possible implementation example. The entry also distinguishes sanitisation from Trusted Types enforcement without treating either as proof that every injection path is protected.

Sources: the WHATWG HTML Standard and MDN documentation, with browser support refreshed through the MDN MCP on 11 September 2026.

Validation: Astro build, ESLint, formatting, Agent Skill integrity and diff checks pass locally. Only the considered entry changes; no spec page or runtime implementation is added.

`Element.setHTML()` is in the HTML Standard and shipped in Chrome 146 and
Firefox 148, but Safari has it in neither desktop nor iOS, so Baseline
status is Limited. Recommending it today would mean recommending a method
that silently does not exist for a large share of visitors, with DOMPurify
as the fallback — which is what sites already do.

Filed as too-early, not out-of-scope: unlike CSS subgrid, whether
untrusted markup gets sanitised is a user-facing outcome. What is unclear
is whether it is an auditable one, and that is the question worth
answering when Safari ships.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploying specification-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2983e67
Status: ✅  Deploy successful!
Preview URL: https://ba30b9cc.specification-website.pages.dev
Branch Preview URL: https://considered-sanitizer-api-202.specification-website.pages.dev

View logs

@jdevalk jdevalk changed the title add(considered): the Sanitizer API is shipping, but not in Safari add(considered): Sanitizer API is too narrow for a standalone spec page Sep 11, 2026
@jdevalk
jdevalk marked this pull request as ready for review September 11, 2026 17:30
@jdevalk
jdevalk merged commit dfbd21d into main Sep 11, 2026
9 checks passed
@jdevalk
jdevalk deleted the considered/sanitizer-api-2026-09-10 branch September 11, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant