Skip to content

script: Add or remove elements in sanitizer#44481

Merged
TimvdLippe merged 2 commits into
servo:mainfrom
kkoyung:sanitizer-add-remove-element
Apr 24, 2026
Merged

script: Add or remove elements in sanitizer#44481
TimvdLippe merged 2 commits into
servo:mainfrom
kkoyung:sanitizer-add-remove-element

Conversation

@kkoyung

@kkoyung kkoyung commented Apr 24, 2026

Copy link
Copy Markdown
Member

Implement the allowElement, removeElement and replaceElementWithChildren methods of the Sanitizer interface, which add or remove elements in a sanitizer.

Specification:

Testing: Covered by WPT tests in sanitizer-api/ subdirectory. Additionally, some tests in sanitizer-basic-filtering.tentative.html are changed from ERROR to FAIL because of this implementation.
Fixes: Part of #43948

Implement the `allowElement`, `removeElement` and
`replaceElementWithChildren` methods of the `Sanitizer` interface, which
add or remove elements in a sanitizer.

Specification:
- https://wicg.github.io/sanitizer-api/#dom-sanitizer-allowelement
- https://wicg.github.io/sanitizer-api/#dom-sanitizer-removeelement
- https://wicg.github.io/sanitizer-api/#dom-sanitizer-replaceelementwithchildren

Testing: Covered by WPT tests in `sanitizer-api/` subdirectory.
Additionally, some tests in `sanitizer-basic-filtering.tentative.html`
are changed from ERROR to FAIL because of this implementation.
Fixes: Part of 43948

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
@kkoyung kkoyung requested a review from gterzian as a code owner April 24, 2026 11:23
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 24, 2026
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
@kkoyung kkoyung mentioned this pull request Apr 24, 2026
24 tasks
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 24, 2026
@TimvdLippe TimvdLippe added this pull request to the merge queue Apr 24, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 24, 2026
Merged via the queue into servo:main with commit 4301054 Apr 24, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 24, 2026
@kkoyung kkoyung deleted the sanitizer-add-remove-element branch May 31, 2026 09:20
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.

3 participants