Skip to content

Commit 84178c2

Browse files
committed
Inline "set data attributes"
1 parent eec46c7 commit 84178c2

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

index.bs

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,23 @@ The <dfn for="Sanitizer" method export>setComments(|allow|)</dfn> method steps a
503503
</div>
504504

505505
<div algorithm>
506-
The <dfn for="Sanitizer" method export>setDataAttributes(|allow|)</dfn> method steps are to [=set data attributes=] with |allow| and [=this=]'s [=Sanitizer/configuration=].
506+
The <dfn for="Sanitizer" method export>setDataAttributes(|allow|)</dfn> method steps are:
507+
508+
1. Let |configuration| be [=this=]'s [=Sanitizer/configuration=].
509+
1. If |configuration|["{{SanitizerConfig/attributes}}"] does not [=map/exist=], then return false.
510+
1. If |configuration|["{{SanitizerConfig/dataAttributes}}"] equals |allow|, then return false.
511+
1. If |allow| is true:
512+
1. [=list/Remove=] any items |attr| from |configuration|["{{SanitizerConfig/attributes}}"]
513+
where |attr| is a [=custom data attribute=].
514+
1. If |configuration|["{{SanitizerConfig/elements}}"] [=map/exists=]:
515+
1. [=list/iterate|For each=] |element| in |configuration|["{{SanitizerConfig/elements}}"]:
516+
1. If |element|[{{SanitizerElementNamespaceWithAttributes/attributes}}] [=map/exists=]:
517+
1. [=list/Remove=] any items |attr| from
518+
|element|[{{SanitizerElementNamespaceWithAttributes/attributes}}]
519+
where |attr| is a [=custom data attribute=].
520+
1. Set |configuration|["{{SanitizerConfig/dataAttributes}}"] to |allow|.
521+
1. Return true.
522+
507523
</div>
508524

509525
<div algorithm>
@@ -1049,26 +1065,6 @@ to fix up per-element allow- or remove-lists to maintain our validity criteria.
10491065
10501066
</div>
10511067
1052-
<div algorithm>
1053-
To <dfn for="Sanitizer">set data attributes</dfn> with a [=boolean=] |allow|
1054-
on a {{SanitizerConfig}} |configuration|:
1055-
1056-
1. If |configuration|["{{SanitizerConfig/attributes}}"] does not [=map/exist=], then return false.
1057-
1. If |configuration|["{{SanitizerConfig/dataAttributes}}"] equals |allow|, then return false.
1058-
1. If |allow| is true:
1059-
1. [=list/Remove=] any items |attr| from |configuration|["{{SanitizerConfig/attributes}}"]
1060-
where |attr| is a [=custom data attribute=].
1061-
1. If |configuration|["{{SanitizerConfig/elements}}"] [=map/exists=]:
1062-
1. [=list/iterate|For each=] |element| in |configuration|["{{SanitizerConfig/elements}}"]:
1063-
1. If |element|[{{SanitizerElementNamespaceWithAttributes/attributes}}] [=map/exists=]:
1064-
1. [=list/Remove=] any items |attr| from
1065-
|element|[{{SanitizerElementNamespaceWithAttributes/attributes}}]
1066-
where |attr| is a [=custom data attribute=].
1067-
1. Set |configuration|["{{SanitizerConfig/dataAttributes}}"] to |allow|.
1068-
1. Return true.
1069-
1070-
</div>
1071-
10721068
<div algorithm>
10731069
To <dfn for="SanitizerConfig">remove unsafe</dfn> from a {{SanitizerConfig}} |configuration|,
10741070
do this:

0 commit comments

Comments
 (0)