Skip to content

Commit

Permalink
More review feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
otherdaniel committed Mar 18, 2024
1 parent b945edb commit dc9adea
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,11 @@ dictionary SanitizerConfig {
<div algorithm>
To <dfn>set and filter HTML</dfn>, given an {{Element}} or {{DocumentFragment}}
|target|, an {{Element}} |contextElement|, a [=string=] |html|, and a
[=dictionary=] |options|, and a [=boolean=] flag |safe|, run these steps:
[=dictionary=] |options|, and a [=boolean=] |safe|:

1. If |safe| and |contextElement|'s [=Element/local name=] is "`script`" and
|contextElement|'s [=Element/namespace=] is the [=HTML namespace=] or the
[=SVG namespace=]:
1. Return.
[=SVG namespace=], then return.
1. Let |config| be the result of calling [=canonicalize a configuration=] on
|options|["`sanitizer`"] and |safe|.
1. Let |newChildren| be the result of the HTML [=fragment parsing algorithm=]
Expand Down Expand Up @@ -499,8 +498,7 @@ if all these conditions are met:


<div algorithm>
In order to <dfn>canonicalize a configuration</dfn> |config| with a boolean
parameter |safe|, run the following steps:
To <dfn>canonicalize a configuration</dfn> |config| with a [=boolean=] |safe|:

Note: The initial set of [=assert=]s assert properties of the built-in
constants, like the [=built-in default config|defaults=] and
Expand All @@ -514,8 +512,7 @@ Note: The initial set of [=assert=]s assert properties of the built-in
"elements" &rightarrow; [=known elements=],
"attributes" &rightarrow; [=known attributes=],
]&raquo; is [=SanitizerConfig/canonical=].
1. If |config| is empty is not |safe|:
1. Return.
1. If |config| is empty is not |safe|, then return.
1. If |config| is not [=SanitizerConfig/valid=], then [=throw=] a {{TypeError}}.
1. Let |result| be a new [=dictionary=].
1. For each |key| of &laquo;[
Expand Down Expand Up @@ -604,8 +601,7 @@ In order to <dfn>canonicalize a sanitizer name</dfn> |name|, with a default
namespace |defaultNamespace|, run the following steps:

1. [=Assert=]: |name| is either a {{DOMString}} or a [=dictionary=].
1. If |name| is a {{DOMString}}:
1. Return &laquo;[ "`name`" &rightarrow; |name|, "`namespace`" &rightarrow; |defaultNamespace|]&raquo;.
1. If |name| is a {{DOMString}}, then return &laquo;[ "`name`" &rightarrow; |name|, "`namespace`" &rightarrow; |defaultNamespace|]&raquo;.
1. [=Assert=]: |name| is a [=dictionary=] and |name|["name"] [=map/exists=].
1. Return &laquo;[ <br>
"`name`" &rightarrow; |name|["name"], <br>
Expand Down

0 comments on commit dc9adea

Please sign in to comment.