-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Change definition of select element list box and drop-down box rendering #11460
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
base: main
Are you sure you want to change the base?
Conversation
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 whatwg#8189
|
This PR implements the plan I wrote in this issue: #8189 The UseCounter data I've collected so far looks OK, but this change might not end up being web compatible. Before I try shipping this and finding out, I'd like feedback on this from Apple and Mozilla. |
|
The following changes are also required: 4.10.7 The select element Aria in HTML(https://w3c.github.io/html-aria/) select (with a multiple attribute or a size attribute having value greater than 1) |
In this HTML PR I am planning on changing the definition of how combobox vs listbox rendering is done with size and multiple attributes: whatwg/html#11460 This PR defers to the HTML definition of display size which defines combobox vs listbox rendering based on multiple and size attributes.
|
Thanks @mtrootyy, I updated that section and opened an aria PR: w3c/html-aria#555 |
|
@zcorpan do you want to review as well? It touches some things you've worked on I think. |
|
Looks good. I think some things can be tested, e.g. with reftest you can check that |
Thanks! I am adding a WPT that does this. |
What should happen on platforms that don't have this capability? |
In chromium, I am implementing this as a popover inside the shadowroot of the select element for desktop platforms. We have also been using a web-based popup document for the single-select picker on windows and linux for as long as I know. By implementing it this way, platform capability doesn't matter, and we could switch it to a native platform implementation later if we want to, as we did for single-select on MacOS. If we have to carve out an exception in the spec while we wait for MacOS to implement this picker in order to get this PR merged, then we could change it to say that |
It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01
It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1523858}
It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1523858}
It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1523858}
…a=testonly Automatic update from web-platform-tests Add WPTs for SelectMobileDesktopParity It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1523858} -- wpt-commits: 47cbbd49085203c27392abcea9560b372593dd6e wpt-pr: 55167
…a=testonly Automatic update from web-platform-tests Add WPTs for SelectMobileDesktopParity It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <domchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1523858} -- wpt-commits: 47cbbd49085203c27392abcea9560b372593dd6e wpt-pr: 55167 UltraBlame original commit: 7602c064ac7e95276637e9ac040d27597b59f75d
…a=testonly Automatic update from web-platform-tests Add WPTs for SelectMobileDesktopParity It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <domchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1523858} -- wpt-commits: 47cbbd49085203c27392abcea9560b372593dd6e wpt-pr: 55167 UltraBlame original commit: 7602c064ac7e95276637e9ac040d27597b59f75d
…a=testonly Automatic update from web-platform-tests Add WPTs for SelectMobileDesktopParity It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <domchromium.org> Commit-Queue: Joey Arhar <jarharchromium.org> Cr-Commit-Position: refs/heads/main{#1523858} -- wpt-commits: 47cbbd49085203c27392abcea9560b372593dd6e wpt-pr: 55167 UltraBlame original commit: 7602c064ac7e95276637e9ac040d27597b59f75d
It was pointed out that we could write interoperable WPTs for the native appearance this way: whatwg/html#11460 (comment) Bug: 439964654 Change-Id: Iaba3a475cf6f5414619ef7e081e1f257a41a6f01 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6967020 Reviewed-by: Dominic Farolino <[email protected]> Commit-Queue: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1523858}
|
@annevk if I changed the definition of |
|
I pushed a commit to make |
|
I could also rewrite it as an algorithm and/or add a table which shows select with different attributes and what their display type becomes |
| box</span>.</p> | ||
| box</span> if its <span data-x="concept-select-size">display size</span> is greater than 1. If the | ||
| <code>select</code> element has a display size of 1, then it may render as a <span>drop-down | ||
| box</span> if the platform supports it, otherwise as a <span>list box</span>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| box</span> if the platform supports it, otherwise as a <span>list box</span>.</p> | |
| box</span> if the platform supports it; otherwise as a <span>list box</span>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is also dropping some nuance. Shouldn't we prefix all the "box" types with "multi-select"? Because a platform might well support a drop-down box, but the question is really if it supports a multi-select drop-down box.
| than 1, is <span>expected</span> to render as a single-select <span>list box</span>.</p> | ||
| attribute is absent, is <span>expected</span> to render as a <span>drop-down box</span> if its | ||
| <span data-x="concept-select-size">display size</span> is 1, or as a <span>list box</span> if its | ||
| <span data-x="concept-select-size">display size</span> is greater than 1.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here I think dropping "single-select" is a mistake.
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 #8189
(See WHATWG Working Mode: Changes for more details.)
/form-elements.html ( diff )
/rendering.html ( diff )