Skip to content

Commit

Permalink
Move "SanitizerAPI" back to experimental.
Browse files Browse the repository at this point in the history
When we shipped Sanitizer API, we split the flag into "SanitizerAPIv0"
(which was promoted to stable and then removed), and reserved the
"SanitizerAPI" for future enhancements. Since we're now removing the API
from stable, we'll gate it on the "SanitizerAPI" flag (instead of re-
introducing the "...v0" variant).

Intent-to-remove here: https://groups.google.com/a/chromium.org/g/blink-dev/c/PNTt4oFXt8c

Bug: 1428276
Change-Id: I79b18184f1a44a85c3eb3b1cfc38b2e54f728e5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4894112
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Yifan Luo <lyf@chromium.org>
Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1202557}
  • Loading branch information
otherdaniel authored and Chromium LUCI CQ committed Sep 28, 2023
1 parent a222f5c commit a24f025
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
12 changes: 7 additions & 5 deletions third_party/blink/renderer/modules/sanitizer_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ go to https://bugs.chromium.org and use the

## Staged / Incremental Rollout

An initial version of the Sanitizer API is enabled by default. Additional
features are scheduled to be launched in stages. The API availability
The Sanitizer API is scheduled to be launched in stages. The API availability
can be controlled via flags:

* `--enable-blink-features=SanitizerAPI`: This includes the sanitization
methods of the `Sanitizer` object, as specified as of 04/2022.
These APIs are likely to change.
* `--enable-blink-features=SanitizerAPIv0`: This includes the basic Sanitizer
API with configuration and the `Element.setHTML` method, but not the
`.sanitizeFor` or `.sanitize` methods. This flag is on by default.
* `--enable-blink-features=SanitizerAPI`: This includes `SanitizerAPv0`
plus the sanitization methods of the `Sanitizer` object, as specified
as of 04/2022. These APIs are likely to change.

The general `--enable-experimental-web-platform-features` flag implies the full
`--enable-blink-features=SanitizerAPI` feature set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dictionary ElementSetHTMLOptions {
};

[
RuntimeEnabled=SanitizerAPI,
SecureContext,
ImplementedAs=ElementSanitizer
] partial interface Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ typedef (DocumentFragment or Document) SanitizerInput;

[
Exposed=Window,
SecureContext
SecureContext,
RuntimeEnabled=SanitizerAPI
] interface Sanitizer {
[MeasureAs=SanitizerAPICreated, CallWith=ExecutionContext, RaisesException] constructor(optional SanitizerConfig config = {});

[MeasureAs=SanitizerAPIToFragment, RuntimeEnabled=SanitizerAPI,
[MeasureAs=SanitizerAPIToFragment,
CallWith=ScriptState, RaisesException] DocumentFragment sanitize(SanitizerInput input);
[MeasureAs=SanitizerAPISanitizeFor, RuntimeEnabled=SanitizerAPI, CallWith=ScriptState, RaisesException] Element? sanitizeFor(DOMString element, DOMString markup);
[MeasureAs=SanitizerAPISanitizeFor, CallWith=ScriptState, RaisesException] Element? sanitizeFor(DOMString element, DOMString markup);

[MeasureAs=SanitizerAPIGetConfig] SanitizerConfig getConfiguration();
[MeasureAs=SanitizerAPIGetDefaultConfig] static SanitizerConfig getDefaultConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ namespace http://www.w3.org/1999/xhtml
property setAttributeNS
property setAttributeNode
property setAttributeNodeNS
property setHTML
property setPointerCapture
property shadowRoot
property showPopover
Expand Down Expand Up @@ -1494,7 +1493,6 @@ namespace http://www.w3.org/2000/svg
property setAttributeNS
property setAttributeNode
property setAttributeNodeNS
property setHTML
property setPointerCapture
property shadowRoot
property slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,6 @@ interface Element : Node
method setAttributeNS
method setAttributeNode
method setAttributeNodeNS
method setHTML
method setPointerCapture
method toggleAttribute
method webkitMatchesSelector
Expand Down Expand Up @@ -8039,11 +8038,6 @@ interface SVGViewElement : SVGElement
getter zoomAndPan
method constructor
setter zoomAndPan
interface Sanitizer
static method getDefaultConfiguration
attribute @@toStringTag
method constructor
method getConfiguration
interface Scheduler
attribute @@toStringTag
method constructor
Expand Down

0 comments on commit a24f025

Please sign in to comment.