Skip to content

Remove support of field-sizing from <select> #11194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sakupi01 opened this issue Apr 7, 2025 · 4 comments
Open

Remove support of field-sizing from <select> #11194

sakupi01 opened this issue Apr 7, 2025 · 4 comments
Labels

Comments

@sakupi01
Copy link

sakupi01 commented Apr 7, 2025

What is the issue with the HTML Standard?

As resolved in w3c/csswg-drafts#11879, <select> will no longer be an element with default preferred size, and the field-sizing: content !important; is going to be added to the new select UA stylesheet spec.

For this reason, it's reasonable to update the existing HTML spec.
e.g. the following and other related parts should be removed&updated:

The select element is an element with default preferred size, and user agents are expected to apply the 'field-sizing' CSS property to select elements.
https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2

Although speccing the new <select>'s UA stylesheet is under construction, I'd love to PR for the default preferred size part!

Filed an issue in CSS: w3c/csswg-drafts#12055

@annevk annevk added topic: rendering topic: select The <select> element labels Apr 7, 2025
@annevk
Copy link
Member

annevk commented Apr 7, 2025

cc @josepharhar @nt1m

@josepharhar
Copy link
Contributor

This only applies when the select has base appearance. With native/primitive appearance, field-sizing is still supported.

@sakupi01
Copy link
Author

sakupi01 commented Apr 7, 2025

@josepharhar
Indeed. This change applies specifically to <select> with base appearance, while <select> with native/primitive appearance will continue to support field-sizing and remain an element with default preferred size.

Given this distinction, I suspect it'd it be more appropriate to update the spec to clarify rather than completely remove the text. Something like:

The select element with native/primitive appearance is an element with default preferred size, and user agents are expected to apply the 'field-sizing' CSS property to such select elements. However, select elements with base appearance have field-sizing: content !important applied in their UA stylesheet.

While the above example should be refined enough, it's worthwhile to add a clarification note to maintain consistency with the CSS spec while also reflecting the new behaviour for <select> with base appearance.

@lukewarlow
Copy link
Member

I don't think this actually needs any edits at all? User agents do apply that property to select, they just happen to force it to content in base appearance mode (this important modifier might be lifted in future if it's desirable).

Though I guess it can't hurt to clarify this (especially as I think it's intended that HTML will own the UA stylesheet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants