From 5d4835a7c2cd081b9b2ebe5b817ae459e9f363b8 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 6 Nov 2025 07:13:08 -0800 Subject: [PATCH] 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.