Skip to content

Commit c8d1bff

Browse files
committed
Improve integration with DOM's cloning steps
Corresponding DOM PR: whatwg/dom#1334.
1 parent aa1c505 commit c8d1bff

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

source

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,8 +3317,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
33173317
<li>The terms <dfn data-x-href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</dfn>,
33183318
<dfn data-x-href="https://dom.spec.whatwg.org/#concept-document-limited-quirks">limited-quirks mode</dfn>, and
33193319
<dfn data-x-href="https://dom.spec.whatwg.org/#concept-document-no-quirks">no-quirks mode</dfn></li>
3320-
<li>The algorithm to <dfn data-x="concept-node-clone" data-x-href="https://dom.spec.whatwg.org/#concept-node-clone">clone</dfn> a <code>Node</code>, and the concept of
3321-
<dfn data-x="concept-node-clone-ext" data-x-href="https://dom.spec.whatwg.org/#concept-node-clone-ext">cloning steps</dfn> used by that algorithm</li>
3320+
<li>The algorithms <dfn data-x="concept-node-clone" data-x-href="https://dom.spec.whatwg.org/#concept-node-clone">clone a node</dfn> and
3321+
<dfn data-x-href="https://dom.spec.whatwg.org/#clone-a-nodes-children">clone a node's children</dfn>, and the concept of
3322+
<dfn data-x="concept-node-clone-ext" data-x-href="https://dom.spec.whatwg.org/#concept-node-clone-ext">cloning steps</dfn></li>
33223323
<li>The concept of <dfn>base URL change steps</dfn> and the definition of what happens when an element is <dfn>affected by a base URL change</dfn></li>
33233324
<li>The concept of an element's <dfn data-x="concept-id" data-x-href="https://dom.spec.whatwg.org/#concept-id">unique identifier (ID)</dfn></li>
33243325
<li>The concept of an element's <dfn data-x="concept-class" data-x-href="https://dom.spec.whatwg.org/#concept-class">classes</dfn></li>
@@ -7713,9 +7714,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
77137714
</ol>
77147715

77157716
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for elements that
7716-
<span>include</span> <code>HTMLOrSVGElement</code> must set the
7717-
<span>[[CryptographicNonce]]</span> slot on the copy to the value of the slot on the element being
7718-
cloned.</p>
7717+
<span>include</span> <code>HTMLOrSVGElement</code> given <var>node</var>, <var>copy</var>, and
7718+
<var>subtree</var> are to set <var>copy</var>'s <span>[[CryptographicNonce]]</span> to
7719+
<var>node</var>'s <span>[[CryptographicNonce]]</span>.</p>
77197720

77207721
<h4>Lazy loading attributes</h4>
77217722

@@ -48236,11 +48237,11 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
4823648237
</div>
4823748238

4823848239
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for <code>input</code> elements
48239-
must propagate the <span data-x="concept-fe-value">value</span>, <span
48240-
data-x="concept-fe-dirty">dirty value flag</span>, <span
48241-
data-x="concept-fe-checked">checkedness</span>, and <span
48242-
data-x="concept-input-checked-dirty-flag">dirty checkedness flag</span> from the node being cloned
48243-
to the copy.</p>
48240+
given <var>node</var>, <var>copy</var>, and <var>subtree</var> are to propagate the <span
48241+
data-x="concept-fe-value">value</span>, <span data-x="concept-fe-dirty">dirty value flag</span>,
48242+
<span data-x="concept-fe-checked">checkedness</span>, and <span
48243+
data-x="concept-input-checked-dirty-flag">dirty checkedness flag</span> from <var>node</var> to
48244+
<var>copy</var>.</p>
4824448245

4824548246
<p>The <span>activation behavior</span> for <code>input</code> elements <var>element</var>, given
4824648247
<var>event</var>, are these steps:</p>
@@ -54846,8 +54847,9 @@ interface <dfn interface>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
5484654847
data-x="concept-textarea-raw-value">raw value</span>.</p>
5484754848

5484854849
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for <code>textarea</code>
54849-
elements must propagate the <span data-x="concept-textarea-raw-value">raw value</span> and <span
54850-
data-x="concept-fe-dirty">dirty value flag</span> from the node being cloned to the copy.</p>
54850+
elements given <var>node</var>, <var>copy</var>, and <var>subtree</var> are to propagate the <span
54851+
data-x="concept-textarea-raw-value">raw value</span> and <span data-x="concept-fe-dirty">dirty
54852+
value flag</span> from <var>node</var> to <var>node</var>.</p>
5485154853

5485254854
<p>The <span>children changed steps</span> for <code>textarea</code> elements must, if the
5485354855
element's <span data-x="concept-fe-dirty">dirty value flag</span> is false, set the element's
@@ -62849,9 +62851,10 @@ o............A....e
6284962851
<var>el</var> does not have an <code data-x="attr-script-async">async</code> or <code
6285062852
data-x="attr-script-defer">defer</code> attribute.</p>
6285162853

62852-
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for a <code>script</code>
62853-
element <var>el</var> being cloned to a copy <var>copy</var> are to set <var>copy</var>'s
62854-
<span>already started</span> to <var>el</var>'s <span>already started</span>.</p>
62854+
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for <code>script</code>
62855+
elements given <var>node</var>, <var>copy</var>, and <var>subtree</var> are to set
62856+
<var>copy</var>'s <span>already started</span> to <var>node</var>'s <span>already
62857+
started</span>.</p>
6285562858

6285662859
<p>When an <code data-x="attr-script-async">async</code> attribute is added to a
6285762860
<code>script</code> element <var>el</var>, the user agent must set <var>el</var>'s
@@ -64254,22 +64257,16 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6425464257

6425564258
<hr>
6425664259

64257-
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for a <code>template</code>
64258-
element <var>node</var> being cloned to a copy <var>copy</var> must run the
64259-
following steps:</p>
64260+
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for <code>template</code>
64261+
elements given a <var>node</var>, <var>copy</var>, and <var>subtree</var> are:</p>
6426064262

6426164263
<ol>
64262-
<li><p>If the <var>clone children flag</var> is not set in the calling <span
64263-
data-x="concept-node-clone">clone</span> algorithm, return.</p></li>
64264-
64265-
<li><p>Let <var>copied contents</var> be the result of <span
64266-
data-x="concept-node-clone">cloning</span> all the children of <var>node</var>'s
64267-
<span>template contents</span>, with <var>document</var> set to <var>copy</var>'s <span>template contents</span>'s <span>node
64268-
document</span>, and with the <var>clone children
64269-
flag</var> set.</p></li>
64264+
<li><p>If <var>subtree</var> is false, then return.</p></li>
6427064265

64271-
<li><p>Append <var>copied contents</var> to <var>copy</var>'s <span>template
64272-
contents</span>.</p></li>
64266+
<li><p><span>Clone a node's children</span> given <var>node</var>'s
64267+
<span>template contents</span>, <var>copy</var>'s <span>template contents</span>,
64268+
<var>copy</var>'s <span>template contents</span>'s <span>node document</span>, and
64269+
<var>subtree</var>.
6427364270
</ol>
6427464271

6427564272
</div>

0 commit comments

Comments
 (0)