Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introspection of Sanitizer configs (and default config). #80

Merged
merged 4 commits into from
Apr 21, 2021

Conversation

otherdaniel
Copy link
Collaborator

New feature: Allow introspection of Sanitizers' configuration. (#77)

dfc0d886f2a6ef32b074f0e81689f296891e06a9
git squash commit for introspection.

a9bad05925e88419d5cf5dd43a0514d262090fcf
wip

4f71d76d8c43898cd2685e0cb4086b4074f787b3
wip

34fe037326dbb851132cc65462fa41a6acd57e06
Continue. Dictionaries can't be attributes.
index.bs Show resolved Hide resolved
index.bs Outdated

// We found a Sanitizer instance. Does it have an allow-list configured?
const a_sanitizer = ...;
!!a_sanitizer.config().allowElements // true, iff an allowElements list is configured
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I'd spell "iff" out (or just use "if") :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

as its [=configuration object=].
* The <dfn method for=Sanitizer><code>sanitize(<var>input</var>)</code></dfn>
method steps are to return the result of running the [=sanitize=]
algorithm on |input|,
* The <dfn method for=Sanitizer><code>sanitizeToString(<var>input</var>)</code></dfn>
method steps are to return the result of running [=sanitizeToString=]
algorithm on |input|.
* The <dfn method for=Sanitizer><code>config()</code></dfn> method steps are
to return the result of running the [=query the sanitizer config=]
algorithm. It essentially returns a copy of the Sanitizer's
Copy link
Member

Choose a reason for hiding this comment

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

Should this sentence be marked as non normative?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. I solved this by removing the sentence, and instead adding an example which compares the two. That way, normativity is clear, and we gain a free example. :-)

@otherdaniel otherdaniel merged commit d10bdfb into WICG:main Apr 21, 2021
@otherdaniel otherdaniel deleted the introspection branch July 13, 2021 14:40
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
Ref: WICG/sanitizer-api#80

Bug: 1202655
Change-Id: I743cedadab7e89bcce6b8248fd299a70c8164c52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2874605
Commit-Queue: Daniel Vogelheim <[email protected]>
Reviewed-by: Yifan Luo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#879407}
NOKEYCHECK=True
GitOrigin-RevId: 31650c7aae8745e581fc625e93f3bdaa73b8753f
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.

5 participants