diff --git a/source b/source index 7190aebdceb..41d16e1ae5e 100644 --- a/source +++ b/source @@ -57336,7 +57336,7 @@ interface HTMLSelectElement : HTMLElement {
  • Run the selectedness setting algorithm given - selectElement.

  • + selectElement and false.

    @@ -57530,34 +57530,78 @@ interface HTMLSelectElement : HTMLElement {
    -

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

    +

    To ask for a reset given an option element option:

    + +
      +
    1. If option's cached nearest ancestor select element is + null, then return.

    2. + +
    3. Run the selectedness setting algorithm given option's cached + nearest ancestor select element and false.

    4. +

    The selectedness setting algorithm, given a select element - element, is to run the following steps:

    - -
      -
    1. If element's multiple attribute is - absent, and element's display size is 1, - and no option elements in the element's list of options have their selectedness set to true, then set the selectedness of the first option - element in the list of options in - tree order that is not disabled, - if any, to true, and return.

    2. - -
    3. If element's multiple attribute is - absent, and two or more option elements in element's list of options have their selectedness set to true, then set the selectedness of all but the last option - element with its selectedness set to true in - the list of options in tree order - to false.

    4. + element and a boolean skipSelectedcontentUpdate, is to run the following + steps:

      + +
        +
      1. If element has the multiple attribute, + then return.

      2. + +
      3. Let updateSelectedcontent be false.

      4. + +
      5. Let firstEnabledOption be null.

      6. + +
      7. Let lastSelectedOption be null.

      8. + +
      9. +

        For each option of element's list of options:

        + +
          +
        1. +

          If option's selectedness is + true:

          + +
            +
          1. +

            If lastSelectedOption is not null:

            + +
              +
            1. Set lastSelectedOption's selectedness to false.

            2. + +
            3. Set updateSelectedcontent to true.

            4. +
            +
          2. + +
          3. Set lastSelectedOption to option.

          4. +
          +
        2. + +
        3. If firstEnabledOption is null and option is not disabled, then set firstEnabledOption to + option.

        4. +
        +
      10. + +
      11. +

        If lastSelectedOption is null and firstEnabledOption is not null and + element's display size is 1:

        + +
          +
        1. Set firstEnabledOption's selectedness to true.

        2. + +
        3. Set updateSelectedcontent to true.

        4. +
        +
      12. + +
      13. If updateSelectedcontent is true and skipSelectedcontentUpdate is + false, then update a select's descendant selectedcontent + elements given element.

    @@ -57569,10 +57613,10 @@ interface HTMLSelectElement : HTMLElement {
    1. Set element's user validity to true.
    2. -
    3. Run update a select's selectedcontent given - element.

    4. +
    5. Update a select's descendant selectedcontent + elements given element.

    6. -
    7. Run clone selected option into select button given +

    8. Clone selected option into select button given element.

    9. Fire an event named HTMLSelectElement : HTMLElement { firstMatchingOption's dirtiness to true.

    10. -
    11. Run update a select's selectedcontent given - select.

    12. +
    13. Update a select's descendant selectedcontent + elements given select.

    @@ -57859,8 +57903,8 @@ interface HTMLSelectElement : HTMLElement { firstMatchingOption's dirtiness to true.

    -
  • Run update a select's selectedcontent given - this.

  • +
  • Update a select's descendant selectedcontent + elements given this.

  • @@ -58421,7 +58465,8 @@ interface HTMLOptionElement : HTMLElement {

    To update an option's nearest ancestor select, given an - option option:

    + option option, run these steps. They return a select element + or null.

    1. Let oldSelect be option's cached nearest ancestor @@ -58430,40 +58475,84 @@ interface HTMLOptionElement : HTMLElement {

    2. Let newSelect be option's option element nearest ancestor select.

    3. +
    4. Set option's cached nearest ancestor select + element to newSelect.

    5. +
    6. If oldSelect is not newSelect:

      1. If oldSelect is not null, then run the selectedness setting - algorithm given oldSelect.

      2. + algorithm given oldSelect and true.

      3. If newSelect is not null, then run the selectedness setting - algorithm given newSelect.

      4. + algorithm given newSelect and true.

    7. -
    8. Set option's cached nearest ancestor select - element to newSelect.

    9. +
    10. Return newSelect.

    The option HTML element insertion steps, given - insertedOption, are to run update an option's nearest ancestor - select given insertedOption.

    + insertedOption, are:

    + +
      +
    1. Let select be the result of update an option's nearest + ancestor select given insertedOption.

    2. + +
    3. If select is null or insertedOption's selectedness is false, or select doesn't + have any descendant selectedcontent elements, then return.

    4. + +
    5. Queue a microtask to update a select's descendant + selectedcontent elements given select.

    6. +

    The option HTML element removing steps, given - removedNode, isSubtreeRoot, and oldAncestor are to run - update an option's nearest ancestor select given - removedNode.

    + removedNode, isSubtreeRoot, and oldAncestor, are:

    + +
      +
    1. Let select be removedNode's cached nearest ancestor + select element.

    2. + +
    3. If removedNode's selectedness is true, select is not null, + and select has at least one descendant selectedcontent + element, then queue a microtask to update a select's descendant + selectedcontent elements given select.

    4. + +
    5. Update an option's nearest ancestor select given + removedNode.

    6. +

    The option HTML element moving steps, given movedNode, - isSubtreeRoot, and oldAncestor are to run update an - option's nearest ancestor select given movedNode.

    + isSubtreeRoot, and oldAncestor, are:

    + +
      +
    1. Let oldSelect be movedNode's cached nearest ancestor + select element.

    2. + +
    3. If oldSelect is not null, movedNode's selectedness is true, and oldSelect has + at least one descendant selectedcontent element, then queue a + microtask to update a select's descendant + selectedcontent elements given oldSelect.

    4. + +
    5. Let newSelect be the result of update an option's nearest + ancestor select given movedNode.

    6. + +
    7. If newSelect is not null, movedNode's selectedness is true, and newSelect has + at least one descendant selectedcontent element, then queue a + microtask to update a select's descendant + selectedcontent elements given newSelect.

    8. +
    @@ -58501,34 +58590,6 @@ interface HTMLOptionElement : HTMLElement {
    -
    -

    To maybe clone an option into selectedcontent, given an - option option:

    - -
      -
    1. Let select be option's option element nearest - ancestor select.

    2. - -
    3. -

      If all of the following conditions are true:

      - -
        -
      • select is not null;

      • - -
      • option's selectedness is - true; and

      • - -
      • select's enabled - selectedcontent is not null,

      • -
      - -

      then run clone an option into a selectedcontent given - option and select's enabled - selectedcontent.

      -
    4. -
    -
    -

    To clone selected option into select button, given a select element select:

    @@ -58549,12 +58610,6 @@ interface HTMLOptionElement : HTMLElement {
    -
    -

    When an option element is popped off the stack of open elements of an - HTML parser or XML parser, the user agent must run maybe clone an - option into selectedcontent given the option element.

    -
    -
    option.selected
    @@ -58629,8 +58684,8 @@ interface HTMLOptionElement : HTMLElement { the element's selectedness is true, and false otherwise. On setting, it must set the element's selectedness to the new value, set its dirtiness to true, and then cause the element to - ask for a reset.

    + data-x="concept-option-dirtiness">dirtiness to true, and then ask for a reset + given this.

    @@ -60384,45 +60439,43 @@ interface HTMLSelectedContentElement : HTMLElementdisabled, which is initially false.

    -

    To update a select's selectedcontent given a - select element select:

    +

    To update a select's descendant selectedcontent elements + given a select element select:

      -
    1. Let selectedcontent be the result of get a select's enabled - selectedcontent given select.

    2. - -
    3. If selectedcontent is null, then return.

    4. +
    5. If select has the multiple + attribute, then return.

    6. -
    7. Let option be the first option in select's list of options whose selectedness is true, if any such option - exists, otherwise null.

    8. +
    9. Let descendantSelectedcontents be select's descendant + selectedcontent elements which are not disabled, in tree order.

    10. -
    11. If option is null, then run clear a selectedcontent - given selectedcontent.

    12. +
    13. +

      For each selectedcontent of descendantSelectedcontents:

      -
    14. Otherwise, run clone an option into a selectedcontent given - option and selectedcontent.

    15. +
        +
      1. Update a selectedcontent given select and + selectedcontent.

      2. +
      +
    -

    To get a select's enabled - selectedcontent given a select element select:

    +

    To update a selectedcontent given a select element + select and a selectedcontent element selectedcontent:

      -
    1. If select has the multiple - attribute, then return null.

    2. - -
    3. Let selectedcontent be the first selectedcontent element - descendant of select in tree order if any such element - exists; otherwise return null.

    4. +
    5. Let option be the first option in select's list of options whose selectedness is true, if any such option + exists; otherwise null.

    6. -
    7. If selectedcontent's disabled is - true, then return null.

    8. +
    9. If option is null, then clear a selectedcontent + given selectedcontent.

    10. -
    11. Return selectedcontent.

    12. +
    13. Otherwise, clone an option into a selectedcontent given + option and selectedcontent.

    @@ -60432,6 +60485,9 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent:

      +
    1. If selectedcontent's disabled is + true, then return.

    2. +
    3. Let documentFragment be a new DocumentFragment whose node document is option's node document.

    4. @@ -60459,37 +60515,52 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent:

        +
      1. If selectedcontent's disabled is + true, then return.

      2. +
      3. Replace all with null within selectedcontent.

    -

    To clear a select's non-primary selectedcontent elements, - given a select element select:

    +

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

      -
    1. Let passedFirstSelectedcontent be false.

    2. +
    3. Let select be the result of recalculate a selectedcontent + element's disabledness given selectedcontent.

    4. -
    5. -

      For each descendant of select's descendants in tree order that is a - selectedcontent element:

      +
    6. If selectedcontent's disabled is + true, select is null, or select has the multiple attribute, then return.

    7. -
        -
      1. If passedFirstSelectedcontent is false, then set - passedFirstSelectedcontent to true.

      2. +
      3. Queue a microtask to update a selectedcontent given + select and selectedcontent.

      4. +
      +
    -
  • Otherwise, run clear a selectedcontent given - descendant.

  • - - +
    +

    The selectedcontent HTML element moving steps, given + selectedcontent, isSubtreeRoot, and oldAncestor, are:

    + +
      +
    1. Let select be the result of recalculate a selectedcontent + element's disabledness given selectedcontent.

    2. + +
    3. If selectedcontent's disabled is + true, select is null, or select has the multiple attribute, then return.

    4. + +
    5. Queue a microtask to update a selectedcontent given + select and selectedcontent.

    -

    The selectedcontent HTML element post-connection steps, given - selectedcontent, are:

    +

    To recalculate a selectedcontent element's disabledness, given a + selectedcontent element selectedcontent, run these steps. They return a + select element or null.

    1. Let nearestSelectAncestor be null.

    2. @@ -60507,7 +60578,7 @@ interface HTMLSelectedContentElement : HTMLElement
    3. If nearestSelectAncestor is null, then set nearestSelectAncestor - to select and continue.

    4. + to ancestor and continue.

    5. Set selectedcontent's disabled to true and break.

    6. @@ -60520,45 +60591,7 @@ interface HTMLSelectedContentElement : HTMLElement -
    7. If selectedcontent's disabled is - true, nearestSelectAncestor is null, or nearestSelectAncestor has the - multiple attribute, then return.

    8. - -
    9. Run update a select's selectedcontent given - nearestSelectAncestor.

    10. - -
    11. Run clear a select's non-primary selectedcontent - elements given nearestSelectAncestor.

    12. -
    -
    - -
    -

    The selectedcontent HTML element removing steps, given - removedNode, isSubtreeRoot, and oldAncestor are:

    - -
      -
    1. If removedNode's disabled is - true, then return.

    2. - -
    3. -

      For each ancestor of removedNode's ancestors, in reverse tree order:

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

      2. -
      -
    4. - -
    5. -

      For each ancestor of oldAncestor's inclusive ancestors, in reverse tree order:

      - -
        -
      1. If ancestor is a select element, then run update a - select's selectedcontent given ancestor and - return.

      2. -
      -
    6. +
    7. Return nearestSelectAncestor.