From 1d64dc111a2d46cbc3cf5bff679438056b4a76f9 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 4 Nov 2025 13:02:48 -0800 Subject: [PATCH 01/26] Build list of selectedcontent elements to clear This PR improves the "clear a select's non-primary selectedcontent elements" algorithm by making it create a list of selectedcontent elements to modify separately from modifying them in order to prevent the list of elements to change while iterating. Fixes https://github.com/whatwg/html/issues/11880 --- source | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source b/source index e6c462593cb..62c0e69cd3a 100644 --- a/source +++ b/source @@ -59127,6 +59127,8 @@ interface HTMLSelectedContentElement : HTMLElement
  • Let passedFirstSelectedcontent be false.

  • +
  • Let selectedcontentElements be « ».

  • +
  • For each descendant of select's descendants in tree order that is a @@ -59136,8 +59138,16 @@ interface HTMLSelectedContentElement : HTMLElement

    If passedFirstSelectedcontent is false, then set passedFirstSelectedcontent to true.

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

  • +
  • Otherwise,

  • append descendant to + selectedcontentElements.

  • + + + +
  • +

    For each selectedcontent of selectedcontentElements:

    + +
      +
    1. Clear a selectedcontent given descendant.

  • From 5d4835a7c2cd081b9b2ebe5b817ae459e9f363b8 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 6 Nov 2025 07:13:08 -0800 Subject: [PATCH 02/26] Update selectedcontent in selectedness setting This PR makes sure that the contents of the selectedcontent element stay up to date when the selected option is changed in the selectedness setting algorithm. This issue was found here: https://github.com/web-platform-tests/wpt/pull/55849#issuecomment-3487964173 --- source | 57 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/source b/source index e6c462593cb..c7b3b3e9340 100644 --- a/source +++ b/source @@ -56241,24 +56241,45 @@ interface HTMLSelectElement : HTMLElement { 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. +
    5. Let updateSelectedcontent be false.

    6. + +
    7. +

      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:

      + +
        +
      1. Set the selectedness of the first option + element in the list of options in + tree order that is not disabled, + if any, to true.

      2. + +
      3. Set updateSelectedcontent to true.

      4. +
      +
    8. + +
    9. +

      Otherwise, 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:

      + +
        +
      1. 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.

      2. + +
      3. Set updateSelectedcontent to true.

      4. +
      +
    10. + +
    11. If updateSelectedcontent is true, then run update a select's + selectedcontent given element.

    From dd2258afe238b42f08a63a8fb55063d4a873b2d1 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 12 Nov 2025 15:33:03 +0900 Subject: [PATCH 03/26] remove duplicate li --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 62c0e69cd3a..a05affd0049 100644 --- a/source +++ b/source @@ -59138,7 +59138,7 @@ interface HTMLSelectedContentElement : HTMLElement

    If passedFirstSelectedcontent is false, then set passedFirstSelectedcontent to true.

    -
  • Otherwise,

  • append descendant to +

  • Otherwise, append descendant to selectedcontentElements.

  • From 85ef15c85b7595403be0c635817f32eb8678f1b8 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 12 Nov 2025 15:34:57 +0900 Subject: [PATCH 04/26] inline one step list --- source | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source b/source index a05affd0049..4ae78ea2dd6 100644 --- a/source +++ b/source @@ -59143,13 +59143,8 @@ interface HTMLSelectedContentElement : HTMLElement -
  • -

    For each selectedcontent of selectedcontentElements:

    - -
      -
    1. Clear a selectedcontent given descendant.

    2. -
    -
  • +
  • For each selectedcontent of selectedcontentElements, clear a + selectedcontent given descendant.

  • From 80e078560d22938fd148a2395461bd0c76325ef4 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 8 Dec 2025 18:35:47 -0800 Subject: [PATCH 05/26] change variable names --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index 4ae78ea2dd6..a4af7f1ea20 100644 --- a/source +++ b/source @@ -59127,7 +59127,7 @@ interface HTMLSelectedContentElement : HTMLElement
  • Let passedFirstSelectedcontent be false.

  • -
  • Let selectedcontentElements be « ».

  • +
  • Let elements be « ».

  • For each descendant of select's HTMLSelectedContentElement : HTMLElementpassedFirstSelectedcontent to true.

  • Otherwise, append descendant to - selectedcontentElements.

  • + elements.

    -
  • For each selectedcontent of selectedcontentElements, clear a - selectedcontent given descendant.

  • +
  • For each element of elements, clear a + selectedcontent given element.

  • From 1998394054f4ed6cace01330afce565f58f92d2b Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 13 Jan 2026 11:24:20 -0800 Subject: [PATCH 06/26] Use cached select in selectedness setting algorithm In order to make the selectedness setting algorithm match implementations, this PR makes the selectedness setting algorithm avoid changing the selectedness of option elements which haven't ran their insertion steps yet by checking whether the options have their cached nearest ancestor select element assigned yet or not. This was discussed here: https://github.com/whatwg/html/issues/11825 --- source | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/source b/source index c674496762c..fa88996a1be 100644 --- a/source +++ b/source @@ -56317,14 +56317,37 @@ interface HTMLSelectElement : HTMLElement { tree order that is not disabled, if any, to true, and return.

    -
  • 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.

  • +
  • +

    If element's multiple attribute is + absent:

    + +
      +
    1. Let lastSelectedOption be null.

    2. + +
    3. +

      For each option in element's list of options in reverse order:

      + +
        +
      1. +

        If option's selectedness + is true:

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

        2. + +
        3. If lastSelectedOption is null, then set lastSelectedOption to + option and continue.

        4. + +
        5. Set option's selectedness to false.

        6. +
        +
      2. +
      +
    4. +
    +
  • From dfec190a526655e0bab2b003a5ee11a97bd4144b Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 15 Jan 2026 12:45:11 -0800 Subject: [PATCH 07/26] nits --- source | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source b/source index c7b3b3e9340..fb84dcb5a33 100644 --- a/source +++ b/source @@ -56245,10 +56245,10 @@ interface HTMLSelectElement : HTMLElement {
  • If element's multiple attribute is - absent, and element's display size is 1, + absent, element's display size is 1, and no option elements in the element's list of options have their selectedness set to true, then:

    + data-x="concept-option-selectedness">selectedness set to true:

    1. Set the HTMLSelectElement : HTMLElement {

    2. Otherwise, if element's multiple - attribute is absent, and two or more option elements in element's option elements in element's list of options have their selectedness set to true, then:

      + data-x="concept-option-selectedness">selectedness set to true:

      1. Set the selectedness of all but the From af049b78ccd8055de18608c28c54376ee9931712 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 15 Jan 2026 12:57:19 -0800 Subject: [PATCH 08/26] readability improvements --- source | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/source b/source index fa88996a1be..4c67344ea69 100644 --- a/source +++ b/source @@ -56318,32 +56318,29 @@ interface HTMLSelectElement : HTMLElement { if any, to true, and return.

      2. -

        If element's multiple attribute is - absent:

        +

        If element has the multiple attribute, + then return.

        -
          -
        1. Let lastSelectedOption be null.

        2. +
        3. Let lastSeen be false.

        4. + +
        5. +

          For each option in element's list of options in reverse order:

          +
          1. -

            For each option in element's list of options in reverse order:

            +

            If option's selectedness + is true:

              -
            1. -

              If option's selectedness - is true:

              +
            2. If option's cached nearest ancestor select + element is null, then continue.

            3. -
                -
              1. If option's cached nearest ancestor select - element is null, then continue.

              2. - -
              3. If lastSelectedOption is null, then set lastSelectedOption to - option and continue.

              4. +
              5. If lastSeen is false, then set lastSeen to true and + continue.

              6. -
              7. Set option's selectedness to false.

              8. -
              - +
            4. Set option's selectedness to false.

          From a51df08b9786d636ac8a702c8ebd87fb6a656d0b Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 15 Jan 2026 14:36:58 -0800 Subject: [PATCH 09/26] rename variable --- source | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source b/source index a4af7f1ea20..b6203639228 100644 --- a/source +++ b/source @@ -59125,7 +59125,7 @@ interface HTMLSelectedContentElement : HTMLElementselect element select:

            -
          1. Let passedFirstSelectedcontent be false.

          2. +
          3. Let seenFirst be false.

          4. Let elements be « ».

          5. @@ -59135,8 +59135,7 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent element:

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

            2. +
            3. If seenFirst is false, then set seenFirst to true.

            4. Otherwise, append descendant to elements.

            5. From 96c2613c64296ae26703db6028c1d9a3b01a316b Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Sun, 15 Mar 2026 18:39:17 -0700 Subject: [PATCH 10/26] Update all descendant selectedcontent elements --- source | 198 +++++++++++++++++++++++---------------------------------- 1 file changed, 80 insertions(+), 118 deletions(-) diff --git a/source b/source index db3cbb5f8c1..a49c93cc8f2 100644 --- a/source +++ b/source @@ -56489,7 +56489,7 @@ interface HTMLSelectElement : HTMLElement {
            6. If updateSelectedcontent is true, then run update a select's - selectedcontent given element.

            7. + descendant selectedcontent elements given element.

            @@ -56526,8 +56526,8 @@ interface HTMLSelectElement : HTMLElement {
        6. -
        7. Update a select's selectedcontent given - select.

        8. +
        9. Update a select's descendant selectedcontent + elements given select.

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

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

        6. Run clone selected option into select button given element.

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

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

        9. +
        10. Run update a select's descendant selectedcontent + elements given this.

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

      3. -
      4. Run update a select's selectedcontent given - this.

      5. +
      6. Run update a select's descendant selectedcontent + elements given this.

      @@ -57466,34 +57466,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:

    @@ -57515,9 +57487,21 @@ 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.

    +

    When an option element option is popped off the stack of open + elements of an HTML parser or XML parser:

    + +
      +
    1. If option is not selected, + then return.

    2. + +
    3. Let select be option's option element nearest + ancestor select.

    4. + +
    5. If select is null, then return.

    6. + +
    7. update a select's descendant selectedcontent + elements given select.

    8. +
    @@ -59335,45 +59319,52 @@ 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 select has the multiple + attribute, then return.

    4. -
    5. If selectedcontent is null, then return.

    6. +
    7. Let descendantSelectedcontents be « ».

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

    10. +
    11. +

      For each descendant of select's descendants:

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

    13. +
        +
      1. If descendant is a selectedcontent element, then append descendant to + descendantSelectedcontents.

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

    15. +
    16. +

      For each selectedcontent in descendantSelectedcontents:

      + +
        +
      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 run clear a selectedcontent + given selectedcontent.

    10. -
    11. Return selectedcontent.

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

    @@ -59383,6 +59374,9 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent:

      +
    1. If selectedcontent is disabled, + then return.

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

    4. @@ -59410,40 +59404,16 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent:

        +
      1. If selectedcontent is disabled, + then return.

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

      -

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

      - -
        -
      1. Let seenFirst be false.

      2. - -
      3. Let elements be « ».

      4. - -
      5. -

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

        - -
          -
        1. If seenFirst is false, then set seenFirst to true.

        2. - -
        3. Otherwise, append descendant to - elements.

        4. -
        -
      6. - -
      7. For each element of elements, clear a - selectedcontent given element.

      8. -
      -
      - -
      -

      The selectedcontent HTML element post-connection steps, given +

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

        @@ -59474,46 +59444,38 @@ interface HTMLSelectedContentElement : HTMLElementdisabled to true and break.

      - -
    5. If selectedcontent's disabled is - true, nearestSelectAncestor is null, or nearestSelectAncestor has the - multiple attribute, then return.

    6. - -
    7. Run update a select's selectedcontent given - nearestSelectAncestor.

    8. - -
    9. Run clear a select's non-primary selectedcontent - elements given nearestSelectAncestor.

    -

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

    +

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

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

    2. +
    3. Let nearestSelectAncestor be null.

    4. -

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

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

      2. +
      3. +

        If ancestor is a select element:

        + +
          +
        1. If nearestSelectAncestor is null, then set nearestSelectAncestor + to select and break.

        2. +
        +
    5. -
    6. -

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

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

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

      2. -
      - +
    9. Update a selectedcontent given select and + selectedcontent.

    From 4b7504208fcac60417b4be1dd765e71bb06328dc Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Sun, 15 Mar 2026 19:18:00 -0700 Subject: [PATCH 11/26] re-merge selectedness setting algorithm --- source | 76 ++++++++++++++++++++++++---------------------------------- 1 file changed, 31 insertions(+), 45 deletions(-) diff --git a/source b/source index a49c93cc8f2..010ccd9d99f 100644 --- a/source +++ b/source @@ -56448,8 +56448,21 @@ interface HTMLSelectElement : HTMLElement { data-x="concept-select-option-list">list of options
    :

      -
    1. If option's cached nearest ancestor select element - is null, then continue.

    2. +
    3. +

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

      + +

      option's cached nearest ancestor select + element is null in the case that option hasn't has its insertion steps called yet. If such an option is selected which can happen if multiple + options in the markup have the selected attribute, then its insertion steps will run this algorithm again, and deselect + insertedSelectedOption. This way, the last option element with the + selected attribute will become the only one with + selectedness.

      +
    4. If option's selectedness is @@ -56478,7 +56491,7 @@ interface HTMLSelectElement : HTMLElement {

    5. -

      If lastSelectedOption is null if firstEnabledOption is not null:

      +

      If lastSelectedOption is null and firstEnabledOption is not null:

      1. Set firstEnabledOption's HTMLSelectElement : HTMLElement {

      -
      -

      To insert a selected option given a select element - select and an option element insertedSelectedOption:

      - -
        -
      1. Assert: insertedSelectedOption's selectedness is true.

      2. - -
      3. -

        For each option in select's list of options:

        - -
          -
        1. -

          If option's selectedness is - true, and option is not insertedSelectedOption, and option's - cached nearest ancestor select element is not null, then set - option's selectedness to - false.

          - -

          option's cached nearest ancestor select - element is null in the case that option hasn't has its insertion steps called yet. If such an option has selectedness, then its insertion steps will run this - algorithm again, and deselect insertedSelectedOption. This way, the last - option element with the selected - attribute will become the only one with selectedness

          -
        2. -
        -
      4. - -
      5. Update a select's descendant selectedcontent - elements given select.

      6. -
      -
      -

      To send select update notifications for a select element element, queue an element task on the user interaction task @@ -57399,12 +57374,23 @@ interface HTMLOptionElement : HTMLElement {

      If newSelect is not null:

        -
      1. If option's selectedness - is true, then insert a selected option given newSelect - and option

      2. +
      3. Let initiallySelected be true if option is selected, otherwise false.

      4. -
      5. Otherwise, run the selectedness setting algorithm given +

      6. Run the selectedness setting algorithm given newSelect.

      7. + +
      8. +

        If initiallySelected is true and option is selected, then update a + select's descendant selectedcontent elements given + newSelect.

        + +

        The selectedness setting algorithm will run update a + select's descendant selectedcontent elements if it selects + a new option. In this case, no new option is getting selected, but we still want to update + selectedcontent elements because a selected option has been inserted.

        +
    From 175b54c9dd2f7022ed70d56f801832a1c3ad0d0f Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 31 Mar 2026 14:25:48 -0700 Subject: [PATCH 12/26] inline loop --- source | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/source b/source index 010ccd9d99f..6e9d154c115 100644 --- a/source +++ b/source @@ -59312,18 +59312,8 @@ interface HTMLSelectedContentElement : HTMLElement

    If select has the multiple attribute, then return.

  • -
  • Let descendantSelectedcontents be « ».

  • - -
  • -

    For each descendant of select's descendants:

    - -
      -
    1. If descendant is a selectedcontent element, then append descendant to - descendantSelectedcontents.

    2. -
    -
  • +
  • Let descendantSelectedcontents be select's descendants that are + selectedcontent elements, in tree order.

  • For each selectedcontent in descendantSelectedcontents:

    From 508808571a2a884d5395819b3e25a9900c211ff2 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 31 Mar 2026 14:26:15 -0700 Subject: [PATCH 13/26] in->of --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 6e9d154c115..65284a16046 100644 --- a/source +++ b/source @@ -59316,7 +59316,7 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent elements, in tree order.

  • -

    For each selectedcontent in descendantSelectedcontents:

    +

    For each selectedcontent of descendantSelectedcontents:

    1. Update a selectedcontent given select and From a09e79cdbb59c6935eecfbe3f026dd2fc8a40095 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 31 Mar 2026 14:26:52 -0700 Subject: [PATCH 14/26] ,->; --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 65284a16046..76b71606cf0 100644 --- a/source +++ b/source @@ -59334,7 +59334,7 @@ interface HTMLSelectedContentElement : HTMLElement

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

    2. + exists; otherwise null.

    3. If option is null, then run clear a selectedcontent given selectedcontent.

    4. From d095eb69c167522e8891c6a4e7de4491444d26e4 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 7 Apr 2026 14:05:56 -0700 Subject: [PATCH 15/26] build list with only enabled selectedcontents --- source | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source b/source index 123542d3454..c1ee00ea613 100644 --- a/source +++ b/source @@ -59492,8 +59492,9 @@ interface HTMLSelectedContentElement : HTMLElement

      If select has the multiple attribute, then return.

      -
    5. Let descendantSelectedcontents be select's descendants that are - selectedcontent elements, in tree order.

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

    8. For each selectedcontent of descendantSelectedcontents:

      From 091d7375eba26dec2b002ec7dc8fd68def081560 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Fri, 10 Apr 2026 17:15:10 -0700 Subject: [PATCH 16/26] dont update selectedcontent in option insertion/removal steps --- source | 66 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/source b/source index c1ee00ea613..bbedd1f7d88 100644 --- a/source +++ b/source @@ -56410,7 +56410,7 @@ interface HTMLSelectElement : HTMLElement {
    9. Run the selectedness setting algorithm given - selectElement.

    10. + selectElement and false.

    @@ -56604,14 +56604,21 @@ 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:

    + element and a boolean insertionOrRemovalSteps, is to run the following + steps:

    1. If element has the multiple attribute, @@ -56681,8 +56688,9 @@ interface HTMLSelectElement : HTMLElement {

  • -
  • If updateSelectedcontent is true, then run update a select's - descendant selectedcontent elements given element.

  • +
  • If updateSelectedcontent is true and insertionOrRemovalSteps is + false, then run update a select's descendant selectedcontent + elements given element.

  • @@ -57548,7 +57556,7 @@ interface HTMLOptionElement : HTMLElement {
    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:

      @@ -57558,19 +57566,7 @@ interface HTMLOptionElement : HTMLElement { data-x="concept-option-selectedness">selected, otherwise false.

    4. Run the selectedness setting algorithm given - newSelect.

    5. - -
    6. -

      If initiallySelected is true and option is selected, then update a - select's descendant selectedcontent elements given - newSelect.

      - -

      The selectedness setting algorithm will run update a - select's descendant selectedcontent elements if it selects - a new option. In this case, no new option is getting selected, but we still want to update - selectedcontent elements because a selected option has been inserted.

      -
    7. + newSelect and true.

    @@ -57584,11 +57580,33 @@ interface HTMLOptionElement : HTMLElement { select
    given insertedOption.

    +
    +

    The option HTML element post-connection steps, given + insertedOption:

    + +

      +
    1. If insertedOption's cached nearest ancestor select + element is not null and insertedOption is selected, then update a select's + descendant selectedcontent elements given insertedOption's + cached nearest ancestor select element.

      .
    2. +
    +
    +

    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: + +
      +
    1. If removedNode is selected + and removedNode's cached nearest ancestor select element is + not null, then queue a microtask to update a select's descendant + selectedcontent elements given removedNode's cached nearest + ancestor select element.

    2. + +
    3. Update an option's nearest ancestor select given + removedNode.

    4. +
    From 86b46b34cf6de80dae16f761f4e758a08fb143e0 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Fri, 10 Apr 2026 17:21:17 -0700 Subject: [PATCH 17/26] add missing display size check --- source | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source b/source index bbedd1f7d88..cb7a3ae4904 100644 --- a/source +++ b/source @@ -56678,7 +56678,8 @@ interface HTMLSelectElement : HTMLElement {
  • -

    If lastSelectedOption is null and firstEnabledOption is not null:

    +

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

    1. Set firstEnabledOption's Date: Thu, 23 Apr 2026 09:11:45 -0700 Subject: [PATCH 18/26] remove unused variable and fix naming --- source | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/source b/source index cb7a3ae4904..a5e08de57ac 100644 --- a/source +++ b/source @@ -57559,17 +57559,8 @@ interface HTMLOptionElement : HTMLElement {

    2. If oldSelect is not null, then run the selectedness setting algorithm given oldSelect and true.

    3. -
    4. -

      If newSelect is not null:

      - -
        -
      1. Let initiallySelected be true if option is selected, otherwise false.

      2. - -
      3. Run the selectedness setting algorithm given - newSelect and true.

      4. -
      -
    5. +
    6. If newSelect is not null, then run the selectedness setting + algorithm given newSelect and true.

  • @@ -59650,8 +59641,8 @@ interface HTMLSelectedContentElement : HTMLElementnearestSelectAncestor is null, or nearestSelectAncestor has the multiple attribute, then return.

    -
  • Update a selectedcontent given select and - selectedcontent.

  • +
  • Update a selectedcontent given nearestSelectAncestor + and selectedcontent.

  • From 57b0f75a6911706a7755d61254f5a04eccc1e5f2 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Sat, 2 May 2026 08:10:13 -0700 Subject: [PATCH 19/26] only queue microtask if there is a selectedcontent element --- source | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source b/source index a5e08de57ac..b221877f7af 100644 --- a/source +++ b/source @@ -57590,11 +57590,15 @@ interface HTMLOptionElement : HTMLElement { removedNode, isSubtreeRoot, and oldAncestor:
      +
    1. Let select be removedNode's cached nearest ancestor + select element.

    2. +
    3. If removedNode is selected - and removedNode's cached nearest ancestor select element is - not null, then queue a microtask to update a select's descendant - selectedcontent elements given removedNode's cached nearest - ancestor select element.

    4. + and select is not null and select has at least one + selectedcontent element descendant, then queue a microtask + to update a select's descendant selectedcontent elements + given removedNode's cached nearest ancestor select + element.

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

    6. From 97700486cbf7edd4e4922e86595a9043a0434ffd Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 11 May 2026 16:56:39 -0700 Subject: [PATCH 20/26] address review comments --- source | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/source b/source index b221877f7af..993c05ae630 100644 --- a/source +++ b/source @@ -56617,7 +56617,7 @@ interface HTMLSelectElement : HTMLElement {

      The selectedness setting algorithm, given a select element - element and a boolean insertionOrRemovalSteps, is to run the following + element and a boolean skipSelectedcontentUpdate, is to run the following steps:

        @@ -56635,22 +56635,6 @@ interface HTMLSelectElement : HTMLElement { data-x="concept-select-option-list">list of options:

          -
        1. -

          If option's cached nearest ancestor select element - is null, then continue.

          - -

          option's cached nearest ancestor select - element is null in the case that option hasn't has its insertion steps called yet. If such an option is selected which can happen if multiple - options in the markup have the selected attribute, then its insertion steps will run this algorithm again, and deselect - insertedSelectedOption. This way, the last option element with the - selected attribute will become the only one with - selectedness.

          -
        2. -
        3. If option's selectedness is true:

          @@ -56689,7 +56673,7 @@ interface HTMLSelectElement : HTMLElement {
        -
      1. If updateSelectedcontent is true and insertionOrRemovalSteps is +

      2. If updateSelectedcontent is true and skipSelectedcontentUpdate is false, then run update a select's descendant selectedcontent elements given element.

      @@ -57574,20 +57558,20 @@ interface HTMLOptionElement : HTMLElement {

      The option HTML element post-connection steps, given - insertedOption:

      + insertedOption, are:

      1. If insertedOption's cached nearest ancestor select element is not null and insertedOption is selected, then update a select's descendant selectedcontent elements given insertedOption's - cached nearest ancestor select element.

        .
      2. + cached nearest ancestor select element.

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

      1. Let select be removedNode's cached nearest ancestor @@ -57597,8 +57581,7 @@ interface HTMLOptionElement : HTMLElement { and select is not null and select has at least one selectedcontent element descendant, then queue a microtask to update a select's descendant selectedcontent elements - given removedNode's cached nearest ancestor select - element.

      2. + given removedNode's select.

      3. Update an option's nearest ancestor select given removedNode.

      4. @@ -57679,7 +57662,7 @@ interface HTMLOptionElement : HTMLElement {
      5. If select is null, then return.

      6. -
      7. update a select's descendant selectedcontent +

      8. Update a select's descendant selectedcontent elements given select.

      @@ -59545,8 +59528,8 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent:

        -
      1. If selectedcontent is disabled, - then return.

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

      4. Let documentFragment be a new DocumentFragment whose node document is option's node document.

      5. @@ -59575,8 +59558,8 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent:

          -
        1. If selectedcontent is disabled, - then return.

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

        4. Replace all with null within selectedcontent.

        5. @@ -59603,7 +59586,7 @@ interface HTMLSelectedContentElement : HTMLElement
        6. If nearestSelectAncestor is null, then set nearestSelectAncestor - to select and continue.

        7. + to ancestor and continue.

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

        9. @@ -59635,7 +59618,7 @@ interface HTMLSelectedContentElement : HTMLElement
        10. If nearestSelectAncestor is null, then set nearestSelectAncestor - to select and break.

        11. + to ancestor and break.

      From d55c0ca2e9a2a5f93cf0788e4c4787e2df34934a Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 12 May 2026 14:11:17 -0700 Subject: [PATCH 21/26] small fixes --- source | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source b/source index 993c05ae630..7f204ea3180 100644 --- a/source +++ b/source @@ -56631,7 +56631,7 @@ interface HTMLSelectElement : HTMLElement {
    7. Let lastSelectedOption be null.

    8. -

      For each option in element's For each option of element's list of options:

        @@ -57558,7 +57558,7 @@ interface HTMLOptionElement : HTMLElement {

        The option HTML element post-connection steps, given - insertedOption, are:

        + insertedOption, are:

        1. If insertedOption's cached nearest ancestor select @@ -57578,10 +57578,10 @@ interface HTMLOptionElement : HTMLElement { select element.

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

        3. + and 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. Update an option's nearest ancestor select given removedNode.

        5. From fb7140c02e130d747838808bfe30b4d1d69d02be Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 13 May 2026 09:39:19 -0700 Subject: [PATCH 22/26] update selectedcontent after moving steps --- source | 115 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 85 insertions(+), 30 deletions(-) diff --git a/source b/source index 7f204ea3180..3e33f99c22f 100644 --- a/source +++ b/source @@ -57590,8 +57590,30 @@ interface HTMLOptionElement : HTMLElement {

          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 and movedNode is selected 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. Update an option's nearest ancestor select given + movedNode.

          6. + +
          7. Let newSelect be movedNode's cached nearest ancestor + select element.

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

          10. +
          @@ -59568,46 +59590,79 @@ interface HTMLSelectedContentElement : HTMLElement

          The selectedcontent HTML element insertion steps, given + selectedcontent, are to recalculate a selectedcontent element's + disabledness given selectedcontent.

          +
          + +
          +

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

            -
          1. Let nearestSelectAncestor be null.

          2. +
          3. Let select be selectedcontent's nearest ancestor select.

          4. -
          5. Set selectedcontent's disabled - to false.

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

          8. + +
          9. Update a selectedcontent given select and + selectedcontent.

          10. +
          +
          + +
          +

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

          + +
            +
          1. Recalculate a selectedcontent element's disabledness given + selectedcontent.

          2. + +
          3. Let select be selectedcontent's nearest ancestor select.

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

          6. + +
          7. Queue a microtask to update a selectedcontent given + select and selectedcontent.

          8. +
          +
          + +
          +

          To get a selectedcontent element's nearest ancestor select, given a + selectedcontent element selectedcontent:

          + +
            +
          1. Let nearestSelectAncestor be null.

          2. For each ancestor of selectedcontent's ancestors, in reverse tree order:

              -
            1. -

              If ancestor is a select element:

              - -
                -
              1. If nearestSelectAncestor is null, then set nearestSelectAncestor - to ancestor and continue.

              2. - -
              3. Set selectedcontent's disabled to true and break.

              4. -
              -
            2. - -
            3. If ancestor is an option element or a - selectedcontent element, then set selectedcontent's disabled to true and break.

            4. +
            5. If ancestor is a select element, then return + ancestor.

          3. + +
          4. Return null.

          -

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

          +

          To recalculate a selectedcontent element's disabledness, given a + selectedcontent element selectedcontent:

          1. Let nearestSelectAncestor be null.

          2. +
          3. Set selectedcontent's disabled + to false.

          4. +
          5. For each ancestor of selectedcontent's ancestors, in reverse tree order:

            @@ -59618,18 +59673,18 @@ interface HTMLSelectedContentElement : HTMLElement
          6. If nearestSelectAncestor is null, then set nearestSelectAncestor - to ancestor and break.

          7. + to ancestor and continue.

            + +
          8. Set selectedcontent's disabled to true and break.

          + +
        6. If ancestor is an option element or a + selectedcontent element, then set selectedcontent's disabled to true and break.

        - -
      1. If selectedcontent's disabled is - true, nearestSelectAncestor is null, or nearestSelectAncestor has the - multiple attribute, then return.

      2. - -
      3. Update a selectedcontent given nearestSelectAncestor - and selectedcontent.

    9. From b5c0c483afdb34526c5408205ee4c9e31692b993 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 5 Jun 2026 10:07:40 +0200 Subject: [PATCH 23/26] nits --- source | 73 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/source b/source index 9f77f606ee7..e180dcdb66e 100644 --- a/source +++ b/source @@ -58502,11 +58502,14 @@ interface HTMLOptionElement : HTMLElement { insertedOption, are:

        -
      1. If insertedOption's cached nearest ancestor select - element is not null and insertedOption is selected, then update a select's - descendant selectedcontent elements given insertedOption's - cached nearest ancestor select element.

      2. +
      3. Let select be insertedOption's cached nearest ancestor + select element.

      4. + +
      5. If select is null or insertedOption's selectedness is false, then return.

      6. + +
      7. Update a select's descendant selectedcontent + elements given select.

      @@ -58518,11 +58521,11 @@ interface HTMLOptionElement : HTMLElement {
    10. Let select be removedNode's cached nearest ancestor select element.

    11. -
    12. If removedNode is selected - and 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.

    13. +
    14. 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.

    15. Update an option's nearest ancestor select given removedNode.

    16. @@ -58531,17 +58534,17 @@ interface HTMLOptionElement : HTMLElement {

      The option HTML element moving steps, given movedNode, - isSubtreeRoot, and oldAncestor are:

      + isSubtreeRoot, and oldAncestor, are:

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

      2. -
      3. If oldSelect is not null and movedNode is selected 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. 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.

      6. Update an option's nearest ancestor select given movedNode.

      7. @@ -58549,11 +58552,11 @@ interface HTMLOptionElement : HTMLElement {
      8. Let newSelect be movedNode's cached nearest ancestor select element.

      9. -
      10. If newSelect is not null and movedNode is selected and newSelect has at least one - descendant selectedcontent element, then queue a microtask - to update a select's descendant selectedcontent elements - given newSelect.

      11. +
      12. 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.

      @@ -58617,13 +58620,11 @@ interface HTMLOptionElement : HTMLElement { elements of an HTML parser or XML parser:

        -
      1. If option is not selected, - then return.

      2. - -
      3. Let select be option's option element nearest - ancestor select.

      4. +
      5. Let select be option's cached nearest ancestor + select element.

      6. -
      7. If select is null, then return.

      8. +
      9. If select is null or option's selectedness is false, then return.

      10. Update a select's descendant selectedcontent elements given select.

      11. @@ -58704,8 +58705,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.

        @@ -60568,14 +60569,11 @@ interface HTMLSelectedContentElement : HTMLElement

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

        + selectedcontent, isSubtreeRoot, and oldAncestor, are:

          -
        1. Recalculate a selectedcontent element's disabledness given - selectedcontent.

        2. - -
        3. Let select be selectedcontent's nearest ancestor select.

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

        6. If selectedcontent's disabled is true, select is null, or select has the HTMLSelectedContentElement : HTMLElement

          To recalculate a selectedcontent element's disabledness, given a - selectedcontent element selectedcontent:

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

          1. Let nearestSelectAncestor be null.

          2. @@ -60640,6 +60639,8 @@ interface HTMLSelectedContentElement : HTMLElementdisabled to true and break.

        7. + +
        8. Return nearestSelectAncestor.

        From 5a4e27d3281bf5c59d861342f9f2ca67c45c03e7 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 5 Jun 2026 10:28:45 +0200 Subject: [PATCH 24/26] make post-connection steps recalculate as well as disabled could have changed in theory --- source | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/source b/source index e180dcdb66e..b602b360da3 100644 --- a/source +++ b/source @@ -57600,7 +57600,7 @@ interface HTMLSelectElement : HTMLElement {
      12. If updateSelectedcontent is true and skipSelectedcontentUpdate is - false, then run update a select's descendant selectedcontent + false, then update a select's descendant selectedcontent elements given element.

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

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

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

      7. Clone selected option into select button given element.

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

      9. -
      10. Run update a select's descendant selectedcontent +

      11. Update a select's descendant selectedcontent elements given select.

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

      -
    17. Run update a select's descendant selectedcontent +

    18. Update a select's descendant selectedcontent elements given this.

    @@ -58493,7 +58493,7 @@ interface HTMLOptionElement : HTMLElement {

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

    @@ -60492,10 +60492,10 @@ interface HTMLSelectedContentElement : HTMLElementselectedness is true, if any such option exists; otherwise null.

    -
  • If option is null, then run clear a selectedcontent +

  • If option is null, then clear a selectedcontent given selectedcontent.

  • -
  • Otherwise, run clone an option into a selectedcontent given +

  • Otherwise, clone an option into a selectedcontent given option and selectedcontent.

  • @@ -60555,8 +60555,8 @@ interface HTMLSelectedContentElement : HTMLElementselectedcontent, are:

      -
    1. Let select be selectedcontent's nearest ancestor select.

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

    4. If selectedcontent's disabled is true, select is null, or select has the HTMLSelectedContentElement : HTMLElement -

      -

      To get a selectedcontent element's nearest ancestor select, given a - selectedcontent element selectedcontent:

      - -
        -
      1. Let nearestSelectAncestor be null.

      2. - -
      3. -

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

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

        2. -
        -
      4. - -
      5. Return null.

      6. -
      -
      -

      To recalculate a selectedcontent element's disabledness, given a selectedcontent element selectedcontent, run these steps. They return a From a35e96a5bf827495b0cde52687af0a5c4e0d4585 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 5 Jun 2026 10:36:34 +0200 Subject: [PATCH 25/26] This demonstrates what it would look like if we only did microtasks; no more post-insertion needed --- source | 52 ++++++++++++---------------------------------------- 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/source b/source index b602b360da3..bf99cf6597f 100644 --- a/source +++ b/source @@ -58465,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 @@ -58488,28 +58489,24 @@ interface HTMLOptionElement : HTMLElement { algorithm given newSelect and true.

    5. + +
    6. Return newSelect.

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

    -
    - -
    -

    The option HTML element post-connection steps, given insertedOption, are:

      -
    1. Let select be insertedOption's cached nearest ancestor - select element.

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

    4. If select is null or insertedOption's selectedness is false, then return.

    5. -
    6. Update a select's descendant selectedcontent - elements given select.

    7. +
    8. Queue a microtask to update a select's descendant + selectedcontent elements given select.

    @@ -58546,11 +58543,8 @@ interface HTMLOptionElement : HTMLElement { microtask
    to update a select's descendant selectedcontent elements given oldSelect.

    -
  • Update an option's nearest ancestor select given - movedNode.

  • - -
  • Let newSelect be movedNode's cached nearest ancestor - select element.

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

  • If newSelect is not null, movedNode's selectedness is true, and newSelect has @@ -58615,22 +58609,6 @@ interface HTMLOptionElement : HTMLElement { -

    -

    When an option element option is popped off the stack of open - elements of an HTML parser or XML parser:

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

    2. - -
    3. If select is null or option's selectedness is false, then return.

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

    6. -
    -
    -
    option.selected
    @@ -60546,12 +60524,6 @@ interface HTMLSelectedContentElement : HTMLElement

    The selectedcontent HTML element insertion steps, given - selectedcontent, are to recalculate a selectedcontent element's - disabledness given selectedcontent.

    - - -
    -

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

      @@ -60562,8 +60534,8 @@ interface HTMLSelectedContentElement : HTMLElementselect is null, or select has the multiple attribute, then return.

      -
    1. Update a selectedcontent given select and - selectedcontent.

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

    From eee149cadb35d92c7551ce1058196fcb42b61ca7 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 10 Jun 2026 13:53:40 -0700 Subject: [PATCH 26/26] any descendant selectedcontent check --- source | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source b/source index bf99cf6597f..41d16e1ae5e 100644 --- a/source +++ b/source @@ -58503,7 +58503,8 @@ interface HTMLOptionElement : HTMLElement { ancestor select
    given insertedOption.

  • If select is null or insertedOption's selectedness is false, then return.

  • + data-x="concept-option-selectedness">selectedness
    is false, or select doesn't + have any descendant selectedcontent elements, then return.

  • Queue a microtask to update a select's descendant selectedcontent elements given select.