diff --git a/source b/source index de407dd6dc0..200d049fc6e 100644 --- a/source +++ b/source @@ -1794,6 +1794,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute stack of open elements of an HTML parser, then process internal resource links given insertedNode's node document.

+ +
  • Run maybe clone option into selectedoption given + insertedNode.

  • The removing steps for the HTML Standard, given @@ -1838,6 +1841,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

  • If removedNode's popover attribute is not in the no popover state, then run the hide popover algorithm given removedNode, false, false, and false.

  • + +
  • Run maybe clone option into selectedoption given + oldParent.

  • A id attribute

  • setAttribute() method
  • textContent attribute
  • +
  • replaceChildren() method
  • The tree, shadow tree, and node tree concepts
  • The tree order and shadow-including tree order concepts
  • @@ -3208,6 +3215,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The child concept
  • The root and shadow-including root concepts
  • The inclusive ancestor, + ancestor, descendant, shadow-including ancestor, shadow-including descendant, @@ -53304,6 +53312,9 @@ interface HTMLSelectElement : HTMLElement { element, and all the option element children of all the optgroup element children of the select element, in tree order.

    +

    Every select element has select descendant selectedoption elements, + which is a list of selectedoption elements, initially « ».

    +

    The required attribute is a boolean attribute. When specified, the user will be required to select a value before submitting the form.

    @@ -54156,6 +54167,61 @@ interface HTMLOptionElement : HTMLElement { +

    To get the option element ancestor select given an option + option:

    + +
      +
    1. +

      For each ancestor of option's ancestors:

      + +
        +
      1. If ancestor is a select, then return + ancestor.

      2. +
      +
    2. + +
    3. Return null.

    4. +
    + +

    To maybe clone option into selectedoption, given an Element + element:

    + +
      +
    1. +

      For each ancestor of element's ancestors:

      + +
        +
      1. +

        If all of the following conditions are true:

        + +
          +
        • ancestor is an option element;

        • + +
        • ancestor has a non-null option element ancestor + select;

        • + +
        • ancestor's option element ancestor select is rendered as a + drop-down box;

        • + +
        • ancestor's selectedness + is true,

        • +
        + +

        then for each selectedoption of ancestor's option element + ancestor select's select descendant selectedoption elements, run + clone an option into a selectedoption given ancestor and + selectedoption.

        +
      2. +
      +
    2. +
    + +

    Whenever an option option's selectedness is set to true, run maybe clone + option into selectedoption given option.

    +
    option.selected
    @@ -55816,6 +55882,121 @@ interface HTMLLegendElement : HTMLElement { +

    The selectedoption element

    + +

    The selectedoption element reflects the contents of a select + element's currently selected option element. selectedoption elements can + be used to declaratively show the selected option element's contents in a different + part of the document, such as the select element's invoker button, with alternate + rendering based on different selectors in the author's stylesheet.

    + +

    Every time the selected option of a select switches from one option + to another, or the currently selected option's descendant DOM structure mutates, the + selectedoption element removes all of its children and replaces them with a new + cloned copy of the DOM structure of the select's selected option + element.

    + +

    selectedoption elements become associated with select elements when + the selectedoption is a descendant of the select.

    + +

    To clone an option into a selectedoption, given an option element + option and a selectedoption element selectedOption:

    + +
      +
    1. Let nodes be « ».

    2. + +
    3. +

      If option is not null, then for each child of option's children:

      + +
        +
      1. Let childClone be the result of running clone given child, null, true.

      2. + +
      3. Append childClone to + nodes.

      4. +
      +
    4. + +
    5. Run replaceChildren on + selectedOption given nodes.

    6. +
    + +

    The selectedoption HTML element insertion steps, given + selectedoption, are:

    + +
      +
    1. Let firstAncestorSelect be null.

    2. + +
    3. Let ancestor be selectedoption's parent.

    4. + +
    5. +

      While firstAncestorSelect is null and ancestor is not + null:

      + +
        +
      1. If ancestor is a select element, then set + firstAncestorSelect to ancestor.

      2. + +
      3. Set ancestor to ancestor's parent.

      4. +
      +
    6. + +
    7. If firstAncestorSelect is null, then return.

    8. + +
    9. Append selectedoption to + firstAncestorSelect's select descendant selectedoption elements.

    10. + +
    11. Run clone an option into a selectedoption given the first option + in firstAncestorSelect's list of + options whose selectedness is true and + insertedNode.

    12. +
    + +

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

    + +
      +
    1. +

      For each ancestor of selectedoption's ancestors:

      + +
        +
      1. If ancestor is a select element, then return.

      2. +
      +
    2. + +
    3. +

      For each ancestor of oldParent's inclusive ancestors:

      + +
        +
      1. +

        If ancestor is a select element, then:

        + +
          +
        1. remove selectedoption from + ancestor's select descendant selectedoption elements.

        2. + +
        3. Run clone an option into a selectedoption given null and + selectedoption.

        4. + +
        5. Return.

        6. +
        +
      2. +
      +
    4. +
    + +

    The following attribute change + steps, given element, localName, oldValue, + value, and namespace are used for all HTML elements in order to + support selectedoption elements:

    + +
      +
    1. Run maybe clone option into selectedoption given element.

    2. +
    +

    Form control infrastructure