From d4c1255f47fe619c0cb562ba30a874bd76d9e120 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 16 Jul 2025 11:47:31 -0700 Subject: [PATCH 1/5] Change definition of list box and drop-down box rendering This PR allows select elements with the multiple attribute to be rendered as a drop-down box when the author explicitly sets the size attribute to 1. The related issue should be resolved by requiring that mobile browsers and desktop browsers both follow these rules in order to improve cross-platform compatibility. Fixes https://github.com/whatwg/html/issues/8189 --- source | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/source b/source index 40fd1244611..22d710ee3f5 100644 --- a/source +++ b/source @@ -139338,12 +139338,9 @@ progress { appearance: auto; }

A select element is either a list box or a drop-down box, depending on its attributes.

-

A select element whose multiple - attribute is present is expected to render as a multi-select list box.

- -

A select element whose multiple - attribute is absent, and whose display size is greater - than 1, is expected to render as a single-select list box.

+

A select element whose display size is + greater than 1 is expected to render as a list box. Otherwise, the + select is expected to render as a drop-down box.

When the element renders as a list box, it is a devolvable widget expected to render as an 'inline-block' box. The inline size of its @@ -139369,16 +139366,14 @@ progress { appearance: auto; } -

A select element whose multiple - attribute is absent, and whose display size is 1, is - expected to render as an 'inline-block' one-line drop-down box. - The inline size of its intrinsic size is the - width of the select's labels. If the 'field-sizing' - property on the element has a computed value of - 'content', the inline size of the - intrinsic size depends on the shown text. The shown text is typically the label of - an option of which selectedness is - set to true.

+

A select element which is being rendered as a drop-down box is + expected to render as an 'inline-block'. The inline size of its + intrinsic size is the width of the select's labels. If the + 'field-sizing' property on the element has a computed value of 'content', the inline size of the + intrinsic size depends on the shown text. The shown text is typically the label of an + option of which selectedness is set + to true.

When the element renders as a drop-down box, it is a devolvable widget. Its appearance in the devolved state, as well as its appearance when the @@ -139407,7 +139402,11 @@ progress { appearance: auto; }

The width of the select's labels is the wider of the width necessary to render the widest optgroup, and the width necessary to render the widest option element in the element's list of - options (including its indent, if any).

+ options (including its indent, if any). If the select has the multiple attribute and is being rendered as a + drop-down box, then the width should also be wide enough to accomodate the text + rendered in the select's button with any combination of options + selected.

If a select element contains a placeholder label option, the user agent is expected to render that option in a manner that conveys that it is a label, From eb7b07b64c0d9787caeb6f26a6833970d2178874 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 23 Jul 2025 08:19:12 -0700 Subject: [PATCH 2/5] remove multiple restriction on placeholder --- source | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source b/source index 22d710ee3f5..ff00044a2e2 100644 --- a/source +++ b/source @@ -54088,11 +54088,10 @@ interface HTMLSelectElement : HTMLElement { a value before submitting the form.

If a select element has a required - attribute specified, does not have a multiple attribute - specified, and has a display size of 1; and if the value of the first option element in the - select element's list of options (if - any) is the empty string, and that option element's parent node is the + attribute specified, and has a display size of 1; and if + the value of the first option element in + the select element's list of options + (if any) is the empty string, and that option element's parent node is the select element (and not an optgroup element), then that option is the select element's placeholder label option.

From 4c9c95cbbf7c06da2eab1dcc78a1b9b06100efc1 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 16 Sep 2025 16:14:26 -0700 Subject: [PATCH 3/5] box --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 9c46c8c540f..18045aaff1f 100644 --- a/source +++ b/source @@ -142518,7 +142518,7 @@ progress { appearance: auto; }

A select element which is being rendered as a drop-down box is - expected to render as an 'inline-block'. The inline size of its + expected to render as an 'inline-block' box. The inline size of its intrinsic size is the width of the select's labels. If the 'field-sizing' property on the element has a computed value of 'content', the inline size of the From d781625ab95d0728a62dbb08d302dc47a7a01a42 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 18 Sep 2025 10:10:50 -0700 Subject: [PATCH 4/5] remove button, add note --- source | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source b/source index 18045aaff1f..12530317082 100644 --- a/source +++ b/source @@ -142619,8 +142619,12 @@ progress { appearance: auto; } options (including its indent, if any). If the select has the multiple attribute and is being rendered as a drop-down box, then the width should also be wide enough to accomodate the text - rendered in the select's button with any combination of options - selected.

+ rendered in the select with any combination of options selected.

+ +

The width of the select's labels has an accomodation for + multiple because some implementations use special text + to represent multiple options being selected, such as "2 selected." In this case, the select needs + to be wide enough to render "2 selected" in addition to the individual options.

If a select element contains a placeholder label option, the user agent is expected to render that option in a manner that conveys that it is a label, From 9b35aa5fb1fbaf1222049d0d57efa29646527e7a Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 13 Nov 2025 14:37:53 +0900 Subject: [PATCH 5/5] make select multiple size=1 platform dependent --- source | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source b/source index 7b2416238f7..6680836bb9a 100644 --- a/source +++ b/source @@ -147663,9 +147663,16 @@ progress { appearance: auto; }

A select element is either a list box or a drop-down box, depending on its attributes.

-

A select element whose display size is - greater than 1 is expected to render as a list box. Otherwise, the - select is expected to render as a drop-down box.

+

A select element whose multiple + attribute is present is expected to render as a multi-select list + box if its display size is greater than 1. If the + select element has a display size of 1, then it may render as a drop-down + box if the platform supports it, otherwise as a list box.

+ +

A select element whose multiple + attribute is absent, is expected to render as a drop-down box if its + display size is 1, or as a list box if its + display size is greater than 1.

When the element renders as a list box, it is a devolvable widget