diff --git a/source b/source index fd018b599ac..906d0ce5ba3 100644 --- a/source +++ b/source @@ -1773,8 +1773,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute data-x="control">controls or U+0020 SPACE).

An HTML element can have specific HTML element insertion steps, HTML element - post-connection steps, and HTML element removing steps, all defined for the - element's local name.

+ post-connection steps, HTML element removing steps, and HTML element moving + steps all defined for the element's local + name.

The insertion steps for the HTML Standard, given insertedNode, are defined as the following:

@@ -1861,6 +1862,29 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute popover algorithm given removedNode, false, false, and false.

+

The moving steps for the HTML Standard, given + movedNode, are defined as the following:

+ +
    +
  1. If movedNode is an element whose namespace is the HTML namespace, and this + standard defines HTML element moving steps for movedNode's local name, then run the corresponding HTML + element moving steps given movedNode.

  2. + +
  3. +

    If movedNode is a form-associated element or the ancestor of a + form-associated element, then:

    + +
      +
    1. If the form-associated element has a form owner and the + form-associated element and its form owner are no longer in the same + tree, then reset the form owner of the form-associated + element.

    2. +
    +
  4. +
+

A node is inserted into a document when the insertion steps are invoked @@ -3218,6 +3242,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • append() method
  • appendChild() method
  • cloneNode() method
  • +
  • moveBefore() method
  • importNode() method
  • preventDefault() method
  • id attribute
  • @@ -3257,6 +3282,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The insertion steps,
  • The post-connection steps, removing steps, + moving steps, adopting steps, and children changed steps hooks for elements
  • The change, append, remove, replace, get an attribute by namespace and local name, set value, and remove an attribute by namespace and local name algorithms for attributes
  • @@ -29020,8 +29046,8 @@ interface HTMLSourceElement : HTMLElement {
    -

    The source HTML element insertion - steps, given insertedNode, are:

    +

    The source HTML element insertion steps, given + insertedNode, are:

    1. If insertedNode's parent is a media element that has no HTMLSourceElement : HTMLElement { mutation for the img element.

    -

    The source HTML element removing - steps, given removedNode and oldParent, are:

    +

    The source HTML element moving steps, given movedNode and + oldParent, are:

    + +
      +
    1. If movedNode's next sibling was an img element and + oldParent is a picture element, then, count this as a relevant mutation for the img element.

    2. +
    + +

    The source HTML element removing steps, given removedNode + and oldParent, are:

    1. If removedNode's next sibling was an img element and @@ -29297,8 +29332,8 @@ interface HTMLImageElement : HTMLElement { page layout from shifting around after the image loads.

    -

    The img HTML element insertion - steps, given insertedNode, are:

    +

    The img HTML element insertion steps, given insertedNode, + are:

    1. If insertedNode's parent is a picture element, then, count this as @@ -29306,8 +29341,16 @@ interface HTMLImageElement : HTMLElement { insertedNode.

    -

    The img HTML element removing - steps, given removedNode and oldParent, are:

    +

    The img HTML element moving steps, given movedNode and + oldParent, are:

    + +
      +
    1. If oldParent is a picture element, then, count this as a + relevant mutation for movedNode.

    2. +
    + +

    The img HTML element removing steps, given removedNode and + oldParent, are:

    1. If oldParent is a picture element, then, count this as a @@ -30807,9 +30850,9 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...

      The element's referrerpolicy attribute's state is changed.

    2. -
    3. The img or source HTML element insertion steps or - HTML element removing steps count the mutation as a relevant mutation.

    4. +
    5. The img or source HTML element insertion steps, + HTML element removing steps, and HTML element moving steps count the + mutation as a relevant mutation.

    6. The element's parent is a picture element and a source element that is a previous sibling has its srcset, MediaError { other node is the node after pointer. Initially, let pointer be the position between the candidate node and the next node, if there are any, or the end of the list, if it is the last node.

      -

      As nodes are inserted and removed into the media element, +

      As nodes are inserted, removed, and moved into the media element, pointer must be updated as follows:

      -
      If a new node is inserted between the two - nodes that define pointer
      +
      If a new node is inserted or moved between the two nodes that define + pointer
      Let pointer be the point between the node before pointer and the new node. In other words, insertions at pointer go after pointer.
      @@ -53462,6 +53507,17 @@ interface HTMLSelectElement : HTMLElement { select element's selectedness setting algorithm.

    +

    The option HTML element moving steps, given movedNode and + oldParent, are:

    + +
      +
    1. Run the option HTML element removing steps given + movedNode and oldParent.

    2. + +
    3. Run the option HTML element insertion steps given + movedNode.

    4. +
    +

    The optgroup HTML element removing steps, given removedNode and oldParent, are:

    @@ -53471,6 +53527,14 @@ interface HTMLSelectElement : HTMLElement { algorithm.

    +

    The optgroup HTML element moving steps, given movedNode + and oldParent, are:

    + +
      +
    1. Run the optgroup HTML element removing steps given + movedNode and oldParent.

    2. +
    +

    If an option element in the list of options asks for a reset, then run that select element's selectedness setting algorithm.

    @@ -55970,12 +56034,11 @@ interface HTMLLegendElement : HTMLElement { form attribute and an element with an ID is inserted into or removed from the - Document, then the user agent must reset the form owner of that - form-associated element.

    + Document, or its HTML element moving steps are run, then the user agent + must reset the form owner of that form-associated element.

    -

    The form owner is also reset by the HTML Standard's insertion steps and removing steps.

    +

    The form owner is also reset by the HTML element insertion steps, + HTML element removing steps, and HTML element moving steps.

    To reset the form owner of a form-associated element element:

    @@ -72128,6 +72191,7 @@ document.body.append(parent); data-x="concept-custom-element-definition-lifecycle-callbacks">lifecycle callbacks
    A map, whose keys are the strings "connectedCallback", "disconnectedCallback", "adoptedCallback", + "connectedMoveCallback", "attributeChangedCallback", "formAssociatedCallback", "formDisabledCallback", @@ -72810,6 +72874,9 @@ customElements.define("x-foo", class extends HTMLElement {
  • When it becomes disconnected, its disconnectedCallback is called, with no arguments.

  • +
  • When it is moved, its connectedMoveCallback is called, with no arguments.

  • +
  • When it is adopted into a new document, its adoptedCallback is called, given the old document and new document as arguments.

  • @@ -72952,10 +73019,39 @@ customElements.define("x-foo", class extends HTMLElement { data-x="concept-custom-element-definition-lifecycle-callbacks">lifecycle callbacks with key callbackName.

    +
  • +

    If callbackName is "connectedMoveCallback" and + callback is null: + +

      +
    1. Let disconnectedCallback be the value of the entry in definition's + lifecycle callbacks + with key "disconnectedCallback".

    2. + +
    3. Let connectedCallback be the value of the entry in definition's + lifecycle callbacks + with key "connectedCallback".

    4. + +
    5. If connectedCallback and disconnectedCallback are null, then + return.

    6. + +
    7. +

      Set callback to the following steps:

      +
        +
      1. If disconnectedCallback is not null, then call + disconnectedCallback with no arguments.

      2. + +
      3. If connectedCallback is not null, then call + connectedCallback with no arguments.

      4. +
      +
    8. +
    +
  • +
  • If callback is null, then return.

  • -

    If callbackName is "attributeChangedCallback", then:

    +

    If callbackName is "attributeChangedCallback":

    1. Let attributeName be the first element of args.