From c8d1bff75bc2fa24aa0a29f90fb449e7920b9280 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 12 Dec 2024 18:35:21 +0100 Subject: [PATCH 1/3] Improve integration with DOM's cloning steps Corresponding DOM PR: https://github.com/whatwg/dom/pull/1334. --- source | 53 +++++++++++++++++++++++++---------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/source b/source index 0553c000382..d098e6acf19 100644 --- a/source +++ b/source @@ -3317,8 +3317,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The terms quirks mode, limited-quirks mode, and no-quirks mode
  • -
  • The algorithm to clone a Node, and the concept of - cloning steps used by that algorithm
  • +
  • The algorithms clone a node and + clone a node's children, and the concept of + cloning steps
  • The concept of base URL change steps and the definition of what happens when an element is affected by a base URL change
  • The concept of an element's unique identifier (ID)
  • The concept of an element's classes
  • @@ -7713,9 +7714,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    The cloning steps for elements that - include HTMLOrSVGElement must set the - [[CryptographicNonce]] slot on the copy to the value of the slot on the element being - cloned.

    + include HTMLOrSVGElement given node, copy, and + subtree are to set copy's [[CryptographicNonce]] to + node's [[CryptographicNonce]].

    Lazy loading attributes

    @@ -48236,11 +48237,11 @@ interface HTMLInputElement : HTMLElement {

    The cloning steps for input elements - must propagate the value, dirty value flag, checkedness, and dirty checkedness flag from the node being cloned - to the copy.

    + given node, copy, and subtree are to propagate the value, dirty value flag, + checkedness, and dirty checkedness flag from node to + copy.

    The activation behavior for input elements element, given event, are these steps:

    @@ -54846,8 +54847,9 @@ interface HTMLTextAreaElement : HTMLElement { data-x="concept-textarea-raw-value">raw value.

    The cloning steps for textarea - elements must propagate the raw value and dirty value flag from the node being cloned to the copy.

    + elements given node, copy, and subtree are to propagate the raw value and dirty + value flag from node to node.

    The children changed steps for textarea elements must, if the element's dirty value flag is false, set the element's @@ -62849,9 +62851,10 @@ o............A....e el does not have an async or defer attribute.

    -

    The cloning steps for a script - element el being cloned to a copy copy are to set copy's - already started to el's already started.

    +

    The cloning steps for script + elements given node, copy, and subtree are to set + copy's already started to node's already + started.

    When an async attribute is added to a script element el, the user agent must set el's @@ -64254,22 +64257,16 @@ interface HTMLTemplateElement : HTMLElement {


    -

    The cloning steps for a template - element node being cloned to a copy copy must run the - following steps:

    +

    The cloning steps for template + elements given a node, copy, and subtree are:

      -
    1. If the clone children flag is not set in the calling clone algorithm, return.

    2. - -
    3. Let copied contents be the result of cloning all the children of node's - template contents, with document set to copy's template contents's node - document, and with the clone children - flag set.

    4. +
    5. If subtree is false, then return.

    6. -
    7. Append copied contents to copy's template - contents.

    8. +
    9. Clone a node's children given node's + template contents, copy's template contents, + copy's template contents's node document, and + subtree.

    From 0de485f7896fb1b7c80a55a2a065615fb91b08fe Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 16 Dec 2024 12:05:53 +0100 Subject: [PATCH 2/3] named arguments \o/ --- source | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/source b/source index d098e6acf19..c7d350e4142 100644 --- a/source +++ b/source @@ -3317,9 +3317,11 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The terms quirks mode, limited-quirks mode, and no-quirks mode
  • -
  • The algorithms clone a node and - clone a node's children, and the concept of - cloning steps
  • +
  • The algorithm clone a node with its arguments + document, + subtree, and + parent, and the concept of + cloning steps
  • The concept of base URL change steps and the definition of what happens when an element is affected by a base URL change
  • The concept of an element's unique identifier (ID)
  • The concept of an element's classes
  • @@ -64263,10 +64265,14 @@ interface HTMLTemplateElement : HTMLElement {
    1. If subtree is false, then return.

    2. -
    3. Clone a node's children given node's - template contents, copy's template contents, - copy's template contents's node document, and - subtree. +

    4. For each child of node's template contents's children, in tree order: clone a node given child with document set to copy's + template contents's node document, subtree set to true, and parent set to copy's template + contents.

    From 962f854d5b30de196fe30856089aa81fc22fe694 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 17 Dec 2024 08:34:33 +0100 Subject: [PATCH 3/3] nit --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index c7d350e4142..a3a13ead119 100644 --- a/source +++ b/source @@ -64260,7 +64260,7 @@ interface HTMLTemplateElement : HTMLElement {

    The cloning steps for template - elements given a node, copy, and subtree are:

    + elements given node, copy, and subtree are:

    1. If subtree is false, then return.