Skip to content

Commit 0569dc8

Browse files
Add Sanitizer API feature (#3171)
1 parent 4b9f9da commit 0569dc8

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

features/draft/spec/sanitizer-api.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

features/sanitizer.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Sanitizer API
2+
description: The `parseHTML()` method for the `Document` interface and the `setHTML()` methods for the `Element` and `ShadowRoot` interfaces parse and insert HTML into the DOM in a way that can prevent cross-site scripting attacks. The `Sanitizer` API can customize the sanitization process.
3+
spec: https://wicg.github.io/sanitizer-api/
4+
compat_features:
5+
# The main entry points.
6+
# There are unsafe variants to these methods in `parse-html-unsafe.yml`.
7+
- api.Element.setHTML
8+
- api.ShadowRoot.setHTML
9+
- api.Document.parseHTML_static
10+
# The Sanitizer interface can optionally be used for custom HTML
11+
# sanitization.
12+
- api.Sanitizer
13+
- api.Sanitizer.Sanitizer
14+
- api.Sanitizer.allowAttribute
15+
- api.Sanitizer.allowElement
16+
- api.Sanitizer.get
17+
- api.Sanitizer.removeAttribute
18+
- api.Sanitizer.removeElement
19+
- api.Sanitizer.removeUnsafe
20+
- api.Sanitizer.replaceElementWithChildren
21+
- api.Sanitizer.setComments
22+
- api.Sanitizer.setDataAttributes

features/draft/spec/sanitizer-api.yml.dist renamed to features/sanitizer.yml.dist

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# Generated from: sanitizer-api.yml
1+
# Generated from: sanitizer.yml
22
# Do not edit this file by hand. Edit the source file instead!
33

44
status:
55
baseline: false
66
support: {}
77
compat_features:
8-
- api.Document.parseHTMLUnsafe_static.options_sanitizer_parameter
98
- api.Document.parseHTML_static
109
- api.Element.setHTML
11-
- api.Element.setHTMLUnsafe.options_sanitizer_parameter
1210
- api.Sanitizer
1311
- api.Sanitizer.Sanitizer
1412
- api.Sanitizer.allowAttribute
@@ -21,4 +19,3 @@ compat_features:
2119
- api.Sanitizer.setComments
2220
- api.Sanitizer.setDataAttributes
2321
- api.ShadowRoot.setHTML
24-
- api.ShadowRoot.setHTMLUnsafe.options_sanitizer_parameter

0 commit comments

Comments
 (0)