Skip to content

Commit c2de55e

Browse files
committed
use correct algos for PIs
1 parent b39ff59 commit c2de55e

1 file changed

Lines changed: 94 additions & 44 deletions

File tree

source

Lines changed: 94 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -125746,7 +125746,8 @@ interface <dfn interface>Sanitizer</dfn> {
125746125746
<ol>
125747125747
<li><p>If <var>configuration</var>["<code
125748125748
data-x="dom-SanitizerConfig-processingInstructions">processingInstructions</code>"] <span
125749-
data-x="list contains">contains</span> <var>pi</var>, then return false.</p></li>
125749+
data-x="contains a processing instruction target">contains</span> <var>pi</var>, then return
125750+
false.</p></li>
125750125751

125751125752
<li><p><span data-x="list append">Append</span> <var>pi</var> to
125752125753
<var>configuration</var>["<code
@@ -125756,19 +125757,20 @@ interface <dfn interface>Sanitizer</dfn> {
125756125757
</ol>
125757125758
</li>
125758125759

125759-
<li><p>Otherwise:</p>
125760+
<li>
125761+
<p>Otherwise:</p>
125760125762

125761125763
<ol>
125762-
<li><p>If <var>configuration</var>["<code
125763-
data-x="dom-SanitizerConfig-removeProcessingInstructions">removeProcessingInstructions</code>"]
125764-
<span>sanitizer config list contains</span> <var>pi</var>, then:</p>
125764+
<li>
125765+
<p>If <var>configuration</var>["<code
125766+
data-x="dom-SanitizerConfig-removeProcessingInstructions">removeProcessingInstructions</code>"]
125767+
<span data-x="contains a processing instruction target">contains</span> <var>pi</var>,
125768+
then:</p>
125765125769

125766125770
<ol>
125767-
<li><p><span data-x="list remove">Remove</span> the item from <var>configuration</var>["<code
125768-
data-x="dom-SanitizerConfig-removeProcessingInstructions">removeProcessingInstructions</code>"]
125769-
whose <code data-x="dom-SanitizerProcessingInstruction-target">target</code> member is
125770-
<var>pi</var>'s <code
125771-
data-x="dom-SanitizerProcessingInstruction-target">target</code>.</p></li>
125771+
<li><p><span data-x="sanitizer config list remove target">Remove</span> <var>pi</var> from
125772+
<var>configuration</var>["<code
125773+
data-x="dom-SanitizerConfig-removeProcessingInstructions">removeProcessingInstructions</code>"].</p></li>
125772125774

125773125775
<li><p>Return true.</p></li>
125774125776
</ol>
@@ -125796,16 +125798,14 @@ interface <dfn interface>Sanitizer</dfn> {
125796125798
data-x="map exists">exists</span>, then:</p>
125797125799

125798125800
<ol>
125799-
<li><p>If <var>configuration</var>["<code
125800-
data-x="dom-SanitizerConfig-processingInstructions">processingInstructions</code>"] <span
125801-
data-x="list contains">contains</span> <var>pi</var>, then:</p>
125801+
<li><p>If <var>configuration</var>["<code
125802+
data-x="dom-SanitizerConfig-processingInstructions">processingInstructions</code>"] <span
125803+
data-x="contains a processing instruction target">contains</span> <var>pi</var>, then:</p>
125802125804

125803-
<ol>
125804-
<li><p><span data-x="list remove">Remove</span> the item from <var>configuration</var>["<code
125805-
data-x="dom-SanitizerConfig-processingInstructions">processingInstructions</code>"] whose
125806-
<code data-x="dom-SanitizerProcessingInstruction-target">target</code> member is
125807-
<var>pi</var>'s <code
125808-
data-x="dom-SanitizerProcessingInstruction-target">target</code>.</p></li>
125805+
<ol>
125806+
<li><p><span data-x="sanitizer config list remove target">Remove</span> <var>pi</var> from
125807+
<var>configuration</var>["<code
125808+
data-x="dom-SanitizerConfig-processingInstructions">processingInstructions</code>"].</p></li>
125809125809

125810125810
<li><p>Return true.</p></li>
125811125811
</ol>
@@ -125818,9 +125818,10 @@ interface <dfn interface>Sanitizer</dfn> {
125818125818
<li><p>Otherwise:</p>
125819125819

125820125820
<ol>
125821-
<li><p>If <var>configuration</var>["<code
125822-
data-x="dom-SanitizerConfig-removeProcessingInstructions">removeProcessingInstructions</code>"]
125823-
<span>sanitizer config list contains</span> <var>pi</var>, then return false.</p></li>
125821+
<li><p>If <var>configuration</var>["<code
125822+
data-x="dom-SanitizerConfig-removeProcessingInstructions">removeProcessingInstructions</code>"]
125823+
<span data-x="contains a processing instruction target">contains</span> <var>pi</var>, then
125824+
return false.</p></li>
125824125825

125825125826
<li><p><span data-x="list append">Append</span> <var>pi</var> to
125826125827
<var>configuration</var>["<code
@@ -126411,8 +126412,8 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126411126412
<span data-x="map exists">exists</span>, then:</p>
126412126413

126413126414
<ol>
126414-
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config list">removing</span>
126415-
<var>element</var> from <var>configuration</var>["<code
126415+
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config
126416+
list">removing</span> <var>element</var> from <var>configuration</var>["<code
126416126417
data-x="dom-SanitizerConfig-replaceWithChildrenElements">replaceWithChildrenElements</code>"].</p></li>
126417126418

126418126419
<li><p>If <var>configuration</var>["<code
@@ -126565,8 +126566,8 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126565126566
data-x="dom-SanitizerElementNamespaceWithAttributes-removeAttributes">removeAttributes</code>"]
126566126567
(or an empty list if it does not exist) is not empty, then return false.</p></li>
126567126568

126568-
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config list">removing</span>
126569-
<var>element</var> from <var>configuration</var>["<code
126569+
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config
126570+
list">removing</span> <var>element</var> from <var>configuration</var>["<code
126570126571
data-x="dom-SanitizerConfig-replaceWithChildrenElements">replaceWithChildrenElements</code>"].</p></li>
126571126572

126572126573
<li><p>If <var>configuration</var>["<code
@@ -126607,12 +126608,12 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126607126608
<li><p>If the <span>built-in non-replaceable elements list</span> <span data-x="list
126608126609
contains">contains</span> <var>element</var>, then return false.</p></li>
126609126610

126610-
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config list">removing</span>
126611-
<var>element</var> from <var>configuration</var>["<code
126611+
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config
126612+
list">removing</span> <var>element</var> from <var>configuration</var>["<code
126612126613
data-x="dom-SanitizerConfig-elements">elements</code>"].</p></li>
126613126614

126614-
<li><p>If <span data-x="remove from sanitizer config list">removing</span> <var>element</var> from
126615-
<var>configuration</var>["<code
126615+
<li><p>If <span data-x="remove from sanitizer config list">removing</span> <var>element</var>
126616+
from <var>configuration</var>["<code
126616126617
data-x="dom-SanitizerConfig-removeElements">removeElements</code>"] is true, then set
126617126618
<var>modified</var> to true.</p></li>
126618126619

@@ -126672,8 +126673,8 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126672126673
<li><p>If <var>element</var>["<code
126673126674
data-x="dom-SanitizerElementNamespaceWithAttributes-attributes">attributes</code>"] (or an
126674126675
empty list if it does not exist) <span>sanitizer config list contains</span>
126675-
<var>attribute</var>, then <span data-x="remove from sanitizer config list">remove</span> <var>attribute</var>
126676-
from <var>element</var>["<code
126676+
<var>attribute</var>, then <span data-x="remove from sanitizer config list">remove</span>
126677+
<var>attribute</var> from <var>element</var>["<code
126677126678
data-x="dom-SanitizerElementNamespaceWithAttributes-attributes">attributes</code>"].</p></li>
126678126679
</ol>
126679126680
</li>
@@ -127248,8 +127249,8 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127248127249
<li><p>Set <var>element</var> to the result of <span>canonicalize a sanitizer element</span> with
127249127250
<var>element</var>.</p></li>
127250127251

127251-
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config list">removing</span>
127252-
<var>element</var> from <var>configuration</var>["<code
127252+
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config
127253+
list">removing</span> <var>element</var> from <var>configuration</var>["<code
127253127254
data-x="dom-SanitizerConfig-replaceWithChildrenElements">replaceWithChildrenElements</code>"].</p></li>
127254127255

127255127256
<li><p>If <var>configuration</var>["<code data-x="dom-SanitizerConfig-elements">elements</code>"]
@@ -127306,8 +127307,8 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127306127307
exists">exists</span>, then:</p>
127307127308

127308127309
<ol>
127309-
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config list">removing</span>
127310-
<var>attribute</var> from <var>configuration</var>["<code
127310+
<li><p>Let <var>modified</var> be the result of <span data-x="remove from sanitizer config
127311+
list">removing</span> <var>attribute</var> from <var>configuration</var>["<code
127311127312
data-x="dom-SanitizerConfig-attributes">attributes</code>"].</p></li>
127312127313

127313127314
<li><p>If <var>configuration</var>["<code
@@ -127374,15 +127375,15 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127374127375
<li><p>If <var>element</var>["<code
127375127376
data-x="dom-SanitizerElementNamespaceWithAttributes-attributes">attributes</code>"] (or an
127376127377
empty list if it does not exist) <span>sanitizer config list contains</span>
127377-
<var>attribute</var>, then <span data-x="remove from sanitizer config list">remove</span> <var>attribute</var>
127378-
from <var>element</var>["<code
127378+
<var>attribute</var>, then <span data-x="remove from sanitizer config list">remove</span>
127379+
<var>attribute</var> from <var>element</var>["<code
127379127380
data-x="dom-SanitizerElementNamespaceWithAttributes-attributes">attributes</code>"].</p></li>
127380127381

127381127382
<li><p>If <var>element</var>["<code
127382127383
data-x="dom-SanitizerElementNamespaceWithAttributes-removeAttributes">removeAttributes</code>"]
127383127384
(or an empty list if it does not exist) <span>sanitizer config list contains</span>
127384-
<var>attribute</var>, then <span data-x="remove from sanitizer config list">remove</span> <var>attribute</var>
127385-
from <var>element</var>["<code
127385+
<var>attribute</var>, then <span data-x="remove from sanitizer config list">remove</span>
127386+
<var>attribute</var> from <var>element</var>["<code
127386127387
data-x="dom-SanitizerElementNamespaceWithAttributes-removeAttributes">removeAttributes</code>"].</p></li>
127387127388
</ol>
127388127389
</li>
@@ -127442,7 +127443,8 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127442127443
</div>
127443127444

127444127445
<div algorithm>
127445-
<p>To <dfn>remove from sanitizer config list</dfn> given an <var>item</var> and a <var>list</var>:</p>
127446+
<p>To <dfn>remove from sanitizer config list</dfn> given an <var>item</var> and a
127447+
<var>list</var>:</p>
127446127448

127447127449
<ol>
127448127450
<li><p>Let <var>removed</var> be false.</p></li>
@@ -127472,12 +127474,21 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127472127474
</div>
127473127475

127474127476
<div algorithm>
127475-
<p>To <dfn>sanitizer config list contains</dfn>, given an item <var>item</var> and a list <var>list</var>:</p>
127477+
<p>To <dfn>sanitizer config list contains</dfn>, given an item <var>item</var> and a list
127478+
<var>list</var>:</p>
127476127479
<ol>
127477127480
<li><p><span data-x="list iterate">For each</span> <var>entry</var> of <var>list</var>:</p>
127478127481
<ol>
127479-
<li><p>If <var>item</var> has a <code data-x="dom-SanitizerProcessingInstruction-target">target</code> member, and <var>entry</var> has a matching <code data-x="dom-SanitizerProcessingInstruction-target">target</code> member, then return true.</p></li>
127480-
<li><p>Otherwise, if <var>item</var>'s <code data-x="dom-SanitizerElementNamespace-name">name</code> member is equal to <var>entry</var>'s <code data-x="dom-SanitizerElementNamespace-name">name</code> member and <var>item</var>'s <code data-x="dom-SanitizerElementNamespace-namespace">_namespace</code> member is equal to <var>entry</var>'s <code data-x="dom-SanitizerElementNamespace-namespace">_namespace</code> member, then return true.</p></li>
127482+
<li><p>If <var>item</var> has a <code
127483+
data-x="dom-SanitizerProcessingInstruction-target">target</code> member, and <var>entry</var>
127484+
has a matching <code data-x="dom-SanitizerProcessingInstruction-target">target</code> member,
127485+
then return true.</p></li>
127486+
<li><p>Otherwise, if <var>item</var>'s <code
127487+
data-x="dom-SanitizerElementNamespace-name">name</code> member is equal to <var>entry</var>'s
127488+
<code data-x="dom-SanitizerElementNamespace-name">name</code> member and <var>item</var>'s
127489+
<code data-x="dom-SanitizerElementNamespace-namespace">_namespace</code> member is equal to
127490+
<var>entry</var>'s <code data-x="dom-SanitizerElementNamespace-namespace">_namespace</code>
127491+
member, then return true.</p></li>
127481127492
</ol>
127482127493
</li>
127483127494
<li><p>Return false.</p></li>
@@ -127495,6 +127506,45 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127495127506
</ol>
127496127507
</div>
127497127508

127509+
<div algorithm>
127510+
<p>To check if a <span>list</span> <var>list</var> <dfn>contains a processing instruction
127511+
target</dfn> given <var>item</var>:</p>
127512+
<ol>
127513+
<li><p><span data-x="list iterate">For each</span> <var>entry</var> of <var>list</var>:</p>
127514+
<ol>
127515+
<li><p>If <var>item</var>'s <code
127516+
data-x="dom-SanitizerProcessingInstruction-target">target</code> member is equal to
127517+
<var>entry</var>'s <code data-x="dom-SanitizerProcessingInstruction-target">target</code>
127518+
member, then return true.</p></li>
127519+
</ol>
127520+
</li>
127521+
<li><p>Return false.</p></li>
127522+
</ol>
127523+
</div>
127524+
127525+
<div algorithm>
127526+
<p>To <dfn>sanitizer config list remove target</dfn>, given an item <var>item</var> and a list
127527+
<var>list</var>:</p>
127528+
<ol>
127529+
<li><p>Let <var>removed</var> be false.</p></li>
127530+
<li><p><span data-x="list iterate">For each</span> <var>entry</var> of <var>list</var>:</p>
127531+
<ol>
127532+
<li><p>If <var>item</var>'s <code
127533+
data-x="dom-SanitizerProcessingInstruction-target">target</code> member is equal to
127534+
<var>entry</var>'s <code data-x="dom-SanitizerProcessingInstruction-target">target</code>
127535+
member, then:</p>
127536+
<ol>
127537+
<li><p><span data-x="list remove">remove</span> <var>entry</var> from
127538+
<var>list</var>.</p></li>
127539+
<li><p>Set <var>removed</var> to true.</p></li>
127540+
</ol>
127541+
</li>
127542+
</ol>
127543+
</li>
127544+
<li><p>Return <var>removed</var>.</p></li>
127545+
</ol>
127546+
</div>
127547+
127498127548
<div algorithm>
127499127549
<p>To <dfn>canonicalize a sanitizer element with attributes</dfn> a
127500127550
<span>SanitizerElementWithAttributes</span> <var>element</var>:</p>

0 commit comments

Comments
 (0)