From 1d64dc111a2d46cbc3cf5bff679438056b4a76f9 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 4 Nov 2025 13:02:48 -0800 Subject: [PATCH 1/3] 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 dd2258afe238b42f08a63a8fb55063d4a873b2d1 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 12 Nov 2025 15:33:03 +0900 Subject: [PATCH 2/3] 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 3/3] 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.