Skip to content

Commit a3eec3a

Browse files
committed
refs
1 parent 87ad7c3 commit a3eec3a

1 file changed

Lines changed: 36 additions & 49 deletions

File tree

source

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3425,6 +3425,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
34253425
<li><dfn data-x-href="https://dom.spec.whatwg.org/#valid-attribute-local-name">valid attribute local name</dfn></li>
34263426
<li><dfn data-x-href="https://dom.spec.whatwg.org/#valid-element-local-name">valid element local name</dfn></li>
34273427
<li><dfn data-x-href="https://dom.spec.whatwg.org/#is-a-global-custom-element-registry">is a global custom element registry</dfn></li>
3428+
<li><dfn data-x-href="https://dom.spec.whatwg.org/#dom-processinginstruction-target" data-x="dom-ProcessingInstruction-target">processing instrucion target</dfn></li>
34283429
</ul>
34293430

34303431
<p>The following features are defined in <cite>UI Events</cite>: <ref>UIEVENTS</ref></p>
@@ -124686,12 +124687,12 @@ partial interface <span id="ShadowRoot-partial">ShadowRoot</span> {
124686124687
[<span>CEReactions</span>] attribute (<code data-x="tt-trustedhtml">TrustedHTML</code> or [<span>LegacyNullToEmptyString</span>] DOMString) <span data-x="dom-ShadowRoot-innerHTML">innerHTML</span>;
124687124688
};
124688124689

124689-
enum <dfn enum>SanitizerPresets</dfn> { "<span data-x="dom-SanitizerPresets-default">default</span>" };
124690+
enum <dfn enum>SanitizerPresets</dfn> { "<dfn data-x="dom-SanitizerPresets-default">default</dfn>" };
124690124691
dictionary <dfn dictionary>SetHTMLOptions</dfn> {
124691-
(<span>Sanitizer</span> or <span>SanitizerConfig</span> or <span>SanitizerPresets</span>) <dfn dict-member for="SetHTMLOptions" data-x="dom-SetHTMLOptions-sanitizer">sanitizer</dfn> = "<span data-x="dom-SanitizerPresets-default">default</span>";
124692+
(<span data-x="dom-Sanitizer">Sanitizer</span> or <span>SanitizerConfig</span> or <span>SanitizerPresets</span>) <dfn dict-member for="SetHTMLOptions" data-x="dom-SetHTMLOptions-sanitizer">sanitizer</dfn> = "<span data-x="dom-SanitizerPresets-default">default</span>";
124692124693
};
124693124694
dictionary <dfn dictionary>SetHTMLUnsafeOptions</dfn> {
124694-
(<span>Sanitizer</span> or <span>SanitizerConfig</span> or <span>SanitizerPresets</span>) <dfn dict-member for="SetHTMLOptions" data-x="dom-SetHTMLUnsafeOptions-sanitizer">sanitizer</dfn> = {};
124695+
(<span data-x="dom-Sanitizer">Sanitizer</span> or <span>SanitizerConfig</span> or <span>SanitizerPresets</span>) <dfn dict-member for="SetHTMLOptions" data-x="dom-SetHTMLUnsafeOptions-sanitizer">sanitizer</dfn> = {};
124695124696
};
124696124697

124697124698
dictionary <dfn dictionary>GetHTMLOptions</dfn> {
@@ -125678,10 +125679,10 @@ interface <dfn interface>XMLSerializer</dfn> {
125678125679
data-x="dom-DOMParser-parseFromString">parseFromString()</code>.</p></dd>
125679125680
</dl>
125680125681

125681-
<h4>The <code>Sanitizer</code> interface</h4>
125682+
<h4>The <code data-x="dom-Sanitizer">Sanitizer</code> interface</h4>
125682125683

125683125684
<pre><code class="idl">[Exposed=Window]
125684-
interface Sanitizer {
125685+
interface <dfn interface data-x="dom-Sanitizer">Sanitizer</dfn> {
125685125686
constructor(optional (SanitizerConfig or SanitizerPresets) configuration = "default");
125686125687

125687125688
// Query configuration:
@@ -125702,7 +125703,7 @@ interface Sanitizer {
125702125703
boolean removeUnsafe();
125703125704
};</code></pre>
125704125705

125705-
<p>A <span>Sanitizer</span> has an associated <dfn for="Sanitizer">configuration</dfn> (a
125706+
<p>A <code data-x="dom-Sanitizer">Sanitizer</code> has an associated <dfn for="Sanitizer">configuration</dfn> (a
125706125707
<span>SanitizerConfig</span>).</p>
125707125708

125708125709
<div algorithm>
@@ -125766,8 +125767,7 @@ interface Sanitizer {
125766125767
<li><p><span data-x="list remove">Remove</span> the item from <var>configuration</var>["<code
125767125768
data-x="dom-SanitizerConfig-removeProcessingInstructions">removeProcessingInstructions</code>"]
125768125769
whose <code data-x="dom-SanitizerProcessingInstruction-target">target</code> member is
125769-
<var>pi</var>'s <code data-x="dom-SanitizerProcessingInstruction-target">target</code>
125770-
member.</p></li>
125770+
<var>pi</var>'s <code data-x="dom-SanitizerProcessingInstruction-target">target</code>.</p></li>
125771125771

125772125772
<li><p>Return true.</p></li>
125773125773
</ol>
@@ -125803,8 +125803,7 @@ interface Sanitizer {
125803125803
<li><p><span data-x="list remove">Remove</span> the item from <var>configuration</var>["<code
125804125804
data-x="dom-SanitizerConfig-processingInstructions">processingInstructions</code>"] whose
125805125805
<code data-x="dom-SanitizerProcessingInstruction-target">target</code> member is
125806-
<var>pi</var>'s <code data-x="dom-SanitizerProcessingInstruction-target">target</code>
125807-
member.</p></li>
125806+
<var>pi</var>'s <code data-x="dom-SanitizerProcessingInstruction-target">target</code>.</p></li>
125808125807

125809125808
<li><p>Return true.</p></li>
125810125809
</ol>
@@ -125833,7 +125832,7 @@ interface Sanitizer {
125833125832

125834125833
<div algorithm>
125835125834
<p>To <dfn for="Sanitizer">set a configuration</dfn>, given a dictionary <var>configuration</var>,
125836-
a boolean <var>allowCommentsPIsAndDataAttributes</var>, and a <span>Sanitizer</span>
125835+
a boolean <var>allowCommentsPIsAndDataAttributes</var>, and a <code data-x="dom-Sanitizer">Sanitizer</code>
125837125836
<var>sanitizer</var>:</p>
125838125837

125839125838
<ol>
@@ -125915,10 +125914,10 @@ interface Sanitizer {
125915125914
</li>
125916125915

125917125916
<li><p>If <var>configuration</var>["<code data-x="dom-SanitizerConfig-comments">comments</code>"]
125918-
does not <span>exist</span>, set it to <var>allowCommentsPIsAndDataAttributes</var>.</p></li>
125917+
does not <span data-x="map exists">exist</span>, set it to <var>allowCommentsPIsAndDataAttributes</var>.</p></li>
125919125918

125920125919
<li><p>If <var>configuration</var>["<code
125921-
data-x="dom-SanitizerConfig-dataAttributes">dataAttributes</code>"] does not <span>exist</span>,
125920+
data-x="dom-SanitizerConfig-dataAttributes">dataAttributes</code>"] does not <span data-x="map exists">exist</span>,
125922125921
set it to <var>allowCommentsPIsAndDataAttributes</var>.</p></li>
125923125922
</ol>
125924125923
</div>
@@ -126016,10 +126015,10 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126016126015

126017126016
<p>Configurations can and ought to be modified by developers to suit their purposes. Options are
126018126017
to write a new <code>SanitizerConfig</code> dictionary from scratch, to modify an existing
126019-
<span>Sanitizer</span>'s configuration by using the modifier methods, or to <code
126020-
data-x="dom-Sanitizer-get">get()</code> an existing <span>Sanitizer</span>'s
126018+
<code data-x="dom-Sanitizer">Sanitizer</code>'s configuration by using the modifier methods, or to <code
126019+
data-x="dom-Sanitizer-get">get()</code> an existing <code data-x="dom-Sanitizer">Sanitizer</code>'s
126021126020
<span>configuration</span> as a dictionary and modify the dictionary and then create a new
126022-
<span>Sanitizer</span> with it.</p>
126021+
<code data-x="dom-Sanitizer">Sanitizer</code> with it.</p>
126023126022

126024126023
<p>An empty configuration allows everything (when called with the "unsafe" methods like <code
126025126024
data-x="dom-Element-setHTMLUnsafe">setHTMLUnsafe()</code>). A configuration "<code
@@ -126252,7 +126251,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126252126251
steps are:</p>
126253126252

126254126253
<p class="note">Outside of the <code data-x="dom-Sanitizer-get">get()</code> method, the order of
126255-
the <span>Sanitizer</span>'s elements and attributes is unobservable. By explicitly sorting the
126254+
the <code data-x="dom-Sanitizer">Sanitizer</code>'s elements and attributes is unobservable. By explicitly sorting the
126256126255
result of this method, we give implementations the opportunity to optimize by, for example, using
126257126256
unordered sets internally.</p>
126258126257

@@ -126266,7 +126265,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126266126265
data-x="map exists">exists</span>, then:</p>
126267126266

126268126267
<ol>
126269-
<li><p><span>For any</span> <var>element</var> of <var>config</var>["<code
126268+
<li><p><span data-x="list iterate">For any</span> <var>element</var> of <var>config</var>["<code
126270126269
data-x="dom-SanitizerConfig-elements">elements</code>"]:</p>
126271126270

126272126271
<ol>
@@ -126299,7 +126298,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126299126298
<li><p>Otherwise:</p>
126300126299
<ol>
126301126300
<li><p>Set <var>config</var>["<code
126302-
data-x="dom-SanitizerConfig-removeElements">removeElements</code>"] to the result of <span>sort
126301+
data-x="dom-SanitizerConfig-removeElements">removeElements</code>"] to the result of <span data-x="list sort">sort
126303126302
in ascending order</span> <var>config</var>["<code
126304126303
data-x="dom-SanitizerConfig-removeElements">removeElements</code>"], with <var>elementA</var>
126305126304
being <span>less than item</span> <var>elementB</var>.</p></li>
@@ -126339,7 +126338,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126339126338

126340126339
<li><p>If <var>config</var>["<code data-x="dom-SanitizerConfig-attributes">attributes</code>"]
126341126340
<span data-x="map exists">exists</span>, then set <var>config</var>["<code
126342-
data-x="dom-SanitizerConfig-attributes">attributes</code>"] to the result of <span>sort in
126341+
data-x="dom-SanitizerConfig-attributes">attributes</code>"] to the result of <span data-x="list sort">sort in
126343126342
ascending order</span> <var>config</var>["<code
126344126343
data-x="dom-SanitizerConfig-attributes">attributes</code>"], with <var>attrA</var> being
126345126344
<span>less than item</span> <var>attrB</var>.</p></li>
@@ -126834,7 +126833,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126834126833
<span data-x="map exists">exists</span>, then set <var>sanitizerSpec</var> to
126835126834
<var>options</var>["<code data-x="dom-SetHTMLOptions-sanitizer">sanitizer</code>"].</p></li>
126836126835

126837-
<li><p><span>Assert</span>: <var>sanitizerSpec</var> is either a <span>Sanitizer</span> instance,
126836+
<li><p><span>Assert</span>: <var>sanitizerSpec</var> is either a <code data-x="dom-Sanitizer">Sanitizer</code> instance,
126838126837
a <span>SanitizerPresets</span> member, or a <span>SanitizerConfig</span> dictionary.</p></li>
126839126838

126840126839
<li><p>If <var>sanitizerSpec</var> is a string, then:</p>
@@ -126851,10 +126850,12 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126851126850
<li><p>If <var>sanitizerSpec</var> is a dictionary, then:</p>
126852126851

126853126852
<ol>
126854-
<li><p>Let <var>sanitizer</var> be a new <span>Sanitizer</span> instance.</p></li>
126853+
<li><p>Let <var>sanitizer</var> be a new <code data-x="dom-Sanitizer">Sanitizer</code> instance.</p></li>
126855126854

126856-
<li><p>If <span>set a configuration</span> <var>sanitizerSpec</var> with (<span>not</span>
126857-
<var>safe</var>) and <var>sanitizer</var> is false, then throw a
126855+
<li><p>Let <var>inverseSafe</var> be true if <var>safe</var> is false; false otherwise.
126856+
126857+
<li><p>If the result of <span data-x="set a configuration">setting a configuration </span> <var>sanitizerSpec</var> with (<var>inverseSafe</var>)
126858+
and <var>sanitizer</var> is false, then throw a
126858126859
<code>TypeError</code>.</p></li>
126859126860

126860126861
<li><p>Set <var>sanitizerSpec</var> to <var>sanitizer</var>.</p></li>
@@ -126866,7 +126867,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126866126867
</div>
126867126868

126868126869
<div algorithm>
126869-
<p>To <dfn>sanitize</dfn> a <code>ParentNode</code> <var>node</var> with a <span>Sanitizer</span>
126870+
<p>To <dfn>sanitize</dfn> a <code>node</code> <var>node</var> with a <code data-x="dom-Sanitizer">Sanitizer</code>
126870126871
<var>sanitizer</var> and a boolean <var>safe</var>:</p>
126871126872

126872126873
<ol>
@@ -126885,14 +126886,14 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126885126886
</div>
126886126887

126887126888
<div algorithm>
126888-
<p>The <dfn>sanitize core</dfn> operation, using a <code>ParentNode</code> <var>node</var>, a
126889+
<p>The <dfn>sanitize core</dfn> operation, using a <code>Node</code> <var>node</var>, a
126889126890
<span>SanitizerConfig</span> <var>configuration</var>, and a boolean
126890126891
<var>handleJavascriptNavigationUrls</var>, recurses over the DOM tree beginning with
126891126892
<var>node</var>. It consists of these steps:</p>
126892126893

126893126894
<ol>
126894126895
<li><p><span data-x="list iterate">For each</span> <var>child</var> of <var>node</var>'s
126895-
<span>children</span>:</p>
126896+
<span data-x="concept-tree-child">children</span>:</p>
126896126897

126897126898
<ol>
126898126899
<li><p><span>Assert</span>: <var>child</var> is a <code>Text</code>, <code>Comment</code>,
@@ -126916,7 +126917,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126916126917
<li><p>If <var>child</var> is a <code>ProcessingInstruction</code> node, then:</p>
126917126918

126918126919
<ol>
126919-
<li><p>Let <var>piTarget</var> be <var>child</var>'s <span>target</span>.</p></li>
126920+
<li><p>Let <var>piTarget</var> be <var>child</var>'s <span data-x="dom-ProcessingInstruction-target">target</span>.</p></li>
126920126921

126921126922
<li><p>If <var>configuration</var>["<code
126922126923
data-x="dom-SanitizerConfig-processingInstructions">processingInstructions</code>"] <span
@@ -126959,7 +126960,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
126959126960
<li><p>Call <span>sanitize core</span> on <var>child</var> with <var>configuration</var>
126960126961
and <var>handleJavascriptNavigationUrls</var>.</p></li>
126961126962

126962-
<li><p><span>Replace all</span> with <var>child</var>'s <span>children</span> within
126963+
<li><p><span data-x="concept-node-replace-all">Replace all</span> with <var>child</var>'s <span data-x="concept-tree-child">children</span> within
126963126964
<var>child</var>.</p></li>
126964126965

126965126966
<li><p><span>Continue</span>.</p></li>
@@ -127101,7 +127102,8 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127101127102

127102127103
<li><p>If <var>url</var> is failure, then return false.</p></li>
127103127104

127104-
<li><p>Return whether <var>url</var>'s <span>scheme</span> is "<code
127105+
<li><p>Return whether <var>url</var>'s <span
127106+
data-x="concept-url-scheme">scheme</span> is "<code
127105127107
data-x="">javascript</code>".</p></li>
127106127108
</ol>
127107127109
</div>
@@ -127167,7 +127169,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127167127169
intended to be a conservative subset of the web platform that is known to be safe. It is subject
127168127170
to change as the platform evolves.</p>
127169127171

127170-
<p>The <dfn>navigating URL attributes list</dfn> is a list of pairs of a
127172+
<p>The <dfn>built-in navigating URL attributes list</dfn> is a list of pairs of a
127171127173
<span>SanitizerElementNamespace</span> and a <span>SanitizerAttributeNamespace</span>:</p>
127172127174

127173127175
<ul>
@@ -127193,7 +127195,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127193127195
data-x="dom-SanitizerAttributeNamespace-namespace">_namespace</code>: null })</p></li>
127194127196
</ul>
127195127197

127196-
<p>The <dfn>animating URL attributes list</dfn> is a list of pairs of a
127198+
<p>The <dfn>built-in animating URL attributes list</dfn> is a list of pairs of a
127197127199
<span>SanitizerElementNamespace</span> and a <span>SanitizerAttributeNamespace</span>:</p>
127198127200

127199127201
<ul>
@@ -127235,21 +127237,6 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127235127237
"http://www.w3.org/1999/xlink" })</p></li>
127236127238
</ul>
127237127239

127238-
<p>The <dfn>built-in non-replaceable elements list</dfn> is a list of
127239-
<span>SanitizerElementNamespace</span> dictionaries:</p>
127240-
127241-
<ul>
127242-
<li><p>{ <code data-x="dom-SanitizerElementNamespace-name">name</code>: "html", <code
127243-
data-x="dom-SanitizerElementNamespace-namespace">_namespace</code>: <span>HTML namespace</span>
127244-
}</p></li>
127245-
<li><p>{ <code data-x="dom-SanitizerElementNamespace-name">name</code>: "head", <code
127246-
data-x="dom-SanitizerElementNamespace-namespace">_namespace</code>: <span>HTML namespace</span>
127247-
}</p></li>
127248-
<li><p>{ <code data-x="dom-SanitizerElementNamespace-name">name</code>: "body", <code
127249-
data-x="dom-SanitizerElementNamespace-namespace">_namespace</code>: <span>HTML namespace</span>
127250-
}</p></li>
127251-
</ul>
127252-
127253127240
<div algorithm>
127254127241
<p>To <dfn>remove an element</dfn> <var>element</var> from a <span>SanitizerConfig</span>
127255127242
<var>configuration</var>:</p>
@@ -127441,7 +127428,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127441127428
</ol>
127442127429
</li>
127443127430

127444-
<li><p><span data-x="list iterate">For each</span> <var>attribute</var> that is an <span>event
127431+
<li><p><span data-x="list iterate">For each</span> <var>attribute</var> that is an <span data-x="event handler content attributes">event
127445127432
handler content attribute</span>:</p>
127446127433

127447127434
<ol>
@@ -127841,7 +127828,7 @@ dictionary <dfn dictionary>SanitizerConfig</dfn> {
127841127828

127842127829
<div algorithm>
127843127830
<p>The <dfn>intersection</dfn> of two lists <var>A</var> and <var>B</var> containing
127844-
<span>SanitizerElement</span> or <span>SanitizerAttribute</span> items is a <a>list</a> containing
127831+
<span>SanitizerElement</span> or <span>SanitizerAttribute</span> items is a <span>list</span> containing
127845127832
all items that are present in both <var>A</var> and <var>B</var>.</p>
127846127833
</div>
127847127834

0 commit comments

Comments
 (0)