From dc9adea3fe26fabfc22ce0663e68b1c05858bfbd Mon Sep 17 00:00:00 2001 From: Daniel Vogelheim Date: Mon, 18 Mar 2024 18:42:20 +0100 Subject: [PATCH] More review feedback. --- index.bs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/index.bs b/index.bs index 8649961..1d5c410 100644 --- a/index.bs +++ b/index.bs @@ -235,12 +235,11 @@ dictionary SanitizerConfig {
To set and filter HTML, 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=] @@ -499,8 +498,7 @@ if all these conditions are met:
-In order to canonicalize a configuration |config| with a boolean -parameter |safe|, run the following steps: +To canonicalize a configuration |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 @@ -514,8 +512,7 @@ Note: The initial set of [=assert=]s assert properties of the built-in "elements" → [=known elements=], "attributes" → [=known attributes=], ]» 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 «[ @@ -604,8 +601,7 @@ In order to canonicalize a sanitizer name |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 «[ "`name`" → |name|, "`namespace`" → |defaultNamespace|]». +1. If |name| is a {{DOMString}}, then return «[ "`name`" → |name|, "`namespace`" → |defaultNamespace|]». 1. [=Assert=]: |name| is a [=dictionary=] and |name|["name"] [=map/exists=]. 1. Return «[
"`name`" → |name|["name"],