Skip to content

Commit

Permalink
Improve integration with DOM's cloning steps
Browse files Browse the repository at this point in the history
Corresponding DOM PR: whatwg/dom#1334.
  • Loading branch information
annevk committed Dec 12, 2024
1 parent aa1c505 commit c8d1bff
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3317,8 +3317,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The terms <dfn data-x-href="https://dom.spec.whatwg.org/#concept-document-quirks">quirks mode</dfn>,
<dfn data-x-href="https://dom.spec.whatwg.org/#concept-document-limited-quirks">limited-quirks mode</dfn>, and
<dfn data-x-href="https://dom.spec.whatwg.org/#concept-document-no-quirks">no-quirks mode</dfn></li>
<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
<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>
<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
<dfn data-x-href="https://dom.spec.whatwg.org/#clone-a-nodes-children">clone a node's children</dfn>, and the concept of
<dfn data-x="concept-node-clone-ext" data-x-href="https://dom.spec.whatwg.org/#concept-node-clone-ext">cloning steps</dfn></li>
<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>
<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>
<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>
Expand Down Expand Up @@ -7713,9 +7714,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
</ol>

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

<h4>Lazy loading attributes</h4>

Expand Down Expand Up @@ -48236,11 +48237,11 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
</div>

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

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

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

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

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

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

<hr>

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

<ol>
<li><p>If the <var>clone children flag</var> is not set in the calling <span
data-x="concept-node-clone">clone</span> algorithm, return.</p></li>

<li><p>Let <var>copied contents</var> be the result of <span
data-x="concept-node-clone">cloning</span> all the children of <var>node</var>'s
<span>template contents</span>, with <var>document</var> set to <var>copy</var>'s <span>template contents</span>'s <span>node
document</span>, and with the <var>clone children
flag</var> set.</p></li>
<li><p>If <var>subtree</var> is false, then return.</p></li>

<li><p>Append <var>copied contents</var> to <var>copy</var>'s <span>template
contents</span>.</p></li>
<li><p><span>Clone a node's children</span> given <var>node</var>'s
<span>template contents</span>, <var>copy</var>'s <span>template contents</span>,
<var>copy</var>'s <span>template contents</span>'s <span>node document</span>, and
<var>subtree</var>.
</ol>

</div>
Expand Down

0 comments on commit c8d1bff

Please sign in to comment.