Skip to content

Sanitizer API: Improve coverage#59323

Open
JKingweb wants to merge 3 commits intoweb-platform-tests:masterfrom
JKingweb:sanitizer-coverage
Open

Sanitizer API: Improve coverage#59323
JKingweb wants to merge 3 commits intoweb-platform-tests:masterfrom
JKingweb:sanitizer-coverage

Conversation

@JKingweb
Copy link
Copy Markdown
Contributor

@JKingweb JKingweb commented Apr 17, 2026

This change improve the coverage of the Sanitizer API Sanitizer object tests in a few areas:

  • allowElement() with a data attribute when data attributes are already allowed
  • The return values of setDataAttributes(), setComments() and removeUnsafe() (Chromium fails here)
  • Modification of the attributes and elements lists when calling setDataAttributes(true)
  • Modification of the attributes and elements lists when calling removeUnsafe()

The last of these might need to be changed because it tests something which is implementation-defined (event content attributes). I tried to pick attributes which wouldn't rely on a particular input method or anything but basic scripting features, though.

Copy link
Copy Markdown
Member

@otherdaniel otherdaniel left a comment

Choose a reason for hiding this comment

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

Thank you very much!

@otherdaniel
Copy link
Copy Markdown
Member

The last of these might need to be changed because it tests something which is implementation-defined (event content attributes). I tried to pick attributes which wouldn't rely on a particular input method or anything but basic scripting features, though.

Yeah, we struggled a bit with this: Event content handler attributes is a spec-defined term. The expectation is that when browsers introduce new event handlers that haven't made it into the spec yet, they'll also handle those. The current draft for the HTML spec goes further and just lists them. I think that gives us plenty examlpes to test against. :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants