Skip to content

Define base appearance for list box select elements - #11758

Merged
zcorpan merged 3 commits into
whatwg:mainfrom
josepharhar:baselistbox
Dec 15, 2025
Merged

zcorpan merged 3 commits into
whatwg:mainfrom
josepharhar:baselistbox

Conversation

@josepharhar

@josepharhar josepharhar commented Oct 7, 2025 •

Copy link
Copy Markdown
Contributor

This PR defines base appearance for select elements which are being rendered as a list box, as opposed to the prior customizable select PR which defined base appearance for drop down select elements.

Fixes #11477

(See WHATWG Working Mode: Changes for more details.)


/form-elements.html ( diff )
/rendering.html ( diff )

Comment thread source Outdated
Comment thread source Outdated
Comment thread source
@zcorpan

zcorpan commented Oct 17, 2025

Copy link
Copy Markdown
Member

I filed #11804 , I can review this again when that is fixed.

I would suggest adding tests in this area that check which UA styles are applied, see e.g. https://github.com/web-platform-tests/wpt/blob/master/html/rendering/widgets/the-select-element/select-as-listbox-default-styles.tentative.html

@josepharhar

Copy link
Copy Markdown
Contributor Author

I filed #11804 , I can review this again when that is fixed.

Thanks, I started a fix: #11805

I would suggest adding tests in this area that check which UA styles are applied, see e.g. https://github.com/web-platform-tests/wpt/blob/master/html/rendering/widgets/the-select-element/select-as-listbox-default-styles.tentative.html

Here is a test I'm working on: https://chromium-review.googlesource.com/c/chromium/src/+/6276680

@josepharhar

Copy link
Copy Markdown
Contributor Author

Now that #11804 has been fixed and I have rebased this PR, and we got a resolution in the sizing issue, and we have a positive standards position from mozilla, this PR is ready for review.

@zcorpan

zcorpan commented Dec 15, 2025

Copy link
Copy Markdown
Member

Some of the linked tests are tentative, is there a PR to make them not tentative?

@josepharhar

Copy link
Copy Markdown
Contributor Author

Some of the linked tests are tentative, is there a PR to make them not tentative?

I added a chromium patch to make them non-tentative, which will generate a WPT PR later

@zcorpan
zcorpan merged commit 84bf1e8 into whatwg:main Dec 15, 2025
2 checks passed
ajperel pushed a commit to chromium/chromium that referenced this pull request Dec 22, 2025
Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1561960}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 22, 2025
Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1561960}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 22, 2025
Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1561960}
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Dec 23, 2025
…t-listbox tests, a=testonly

Automatic update from web-platform-tests
Remove tentative from customizable-select-listbox tests

Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1561960}

--

wpt-commits: b142a76f0ffffbc95b9053f30dacb2a4737e7f6a
wpt-pr: 56900
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jan 1, 2026
…t-listbox tests, a=testonly

Automatic update from web-platform-tests
Remove tentative from customizable-select-listbox tests

Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonfchromium.org>
Reviewed-by: Joey Arhar <jarharchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1561960}

--

wpt-commits: b142a76f0ffffbc95b9053f30dacb2a4737e7f6a
wpt-pr: 56900

UltraBlame original commit: 844b957c47941e80044e2d5c41b415f98cb7c920
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Jan 1, 2026
…t-listbox tests, a=testonly

Automatic update from web-platform-tests
Remove tentative from customizable-select-listbox tests

Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonfchromium.org>
Reviewed-by: Joey Arhar <jarharchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1561960}

--

wpt-commits: b142a76f0ffffbc95b9053f30dacb2a4737e7f6a
wpt-pr: 56900

UltraBlame original commit: 844b957c47941e80044e2d5c41b415f98cb7c920
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jan 1, 2026
…t-listbox tests, a=testonly

Automatic update from web-platform-tests
Remove tentative from customizable-select-listbox tests

Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonfchromium.org>
Reviewed-by: Joey Arhar <jarharchromium.org>
Commit-Queue: Joey Arhar <jarharchromium.org>
Cr-Commit-Position: refs/heads/main{#1561960}

--

wpt-commits: b142a76f0ffffbc95b9053f30dacb2a4737e7f6a
wpt-pr: 56900

UltraBlame original commit: 844b957c47941e80044e2d5c41b415f98cb7c920
KurtCattiSchmidt pushed a commit to KurtCattiSchmidt/wpt-ahem that referenced this pull request Jan 21, 2026
Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1561960}
Almaju pushed a commit to Almaju/firefox that referenced this pull request Jun 9, 2026
…t-listbox tests, a=testonly

Automatic update from web-platform-tests
Remove tentative from customizable-select-listbox tests

Spec PR: whatwg/html#11758

Bug: 357649033
Change-Id: I259786e661f5eeb7f3cb6d1c29cce9c82f92795c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7262091
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1561960}

--

wpt-commits: b142a76f0ffffbc95b9053f30dacb2a4737e7f6a
wpt-pr: 56900
annevk added a commit to annevk/WebKit that referenced this pull request Sep 21, 2026
https://bugs.webkit.org/show_bug.cgi?id=324529
rdar://187768967

Reviewed by NOBODY (OOPS!).

Prototype behind HTMLEnhancedSelectMultipleAndListBoxEnabled, unstable and off
by default. It implements whatwg/html#12069, which adds
the multi-select drop-down box, together with the list box base appearance from
whatwg/html#11758.

With base appearance the display size picks the box type: 1 is a drop-down box
and anything larger is a list box, whether or not multiple is present.

HTMLSelectElement gets two new primitives to cover this:

- usesBaseAppearance(), which folds in whether base appearance is supported for
  this box type at all. Without the preference only the drop-down box without
  multiple is, so a <select size=4> with appearance: base-select still renders
  natively.
- boxType(), which is the display size under base appearance and usesMenuList()
  otherwise. usesMenuList() keeps its attribute-only meaning of "native
  drop-down box" and still backs :-internal-uses-menulist.

isDropDownBox(), isBaseDropDownBox() and isBaseListBox() derive from these, so
the preference boundary stays in one place.

A base list box needs no shadow tree changes. ::picker does not apply to a list
box, so its select popover keeps display: contents and the options lay out
inline; childShouldCreateRenderer() lets them through and excludes the button
slot. Its block size is as many rows as the display size, computed in
Style::Adjuster rather than the user agent stylesheet, per the FIXME.

Two pseudo-element gates had to move together: StyleTreeResolver decides whether
::checkmark and ::picker-icon resolve a style, while RenderTreeBuilderFormControls
decides whether the box is created, and the latter took its appearance from the
picker's renderer, which a list box does not have.

Tests: fast/forms/select/base/select-listbox.html
       fast/forms/select/base/select-multiple-picker.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Base appearance for list box select elements

3 participants