Change definition of select element list box and drop-down box rendering#11460
Change definition of select element list box and drop-down box rendering#11460annevk merged 10 commits intowhatwg:mainfrom
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 <dom@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> 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 <dom@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> 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 <dom@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> 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 <dom@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> 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 <dom@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> 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 |
|
@annevk Would you mind taking another look at this? |
annevk
left a comment
There was a problem hiding this comment.
Apologies for the delay here, this looks good now. Once you complete OP I'll merge.
Now that the spec PR has been merged, we can remove tentative from these tests: whatwg/html#11460 This patch also adds another test to make sure that <select size=2> is rendered as a listbox instead of a drop-down box. Bug: 439964654 Change-Id: I08cc9b0ddc6940f1c42c0680e033b5ed1df5d09f
Now that the spec PR has been merged, we can remove tentative from these tests: whatwg/html#11460 This patch also adds another test to make sure that <select size=2> is rendered as a listbox instead of a drop-down box. Bug: 439964654 Change-Id: I08cc9b0ddc6940f1c42c0680e033b5ed1df5d09f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7682757 Reviewed-by: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Reviewed-by: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1608215}
Now that the spec PR has been merged, we can remove tentative from these tests: whatwg/html#11460 This patch also adds another test to make sure that <select size=2> is rendered as a listbox instead of a drop-down box. Bug: 439964654 Change-Id: I08cc9b0ddc6940f1c42c0680e033b5ed1df5d09f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7682757 Reviewed-by: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Reviewed-by: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1608215}
Now that the spec PR has been merged, we can remove tentative from these tests: whatwg/html#11460 This patch also adds another test to make sure that <select size=2> is rendered as a listbox instead of a drop-down box. Bug: 439964654 Change-Id: I08cc9b0ddc6940f1c42c0680e033b5ed1df5d09f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7682757 Reviewed-by: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Reviewed-by: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1608215}
…tentative, a=testonly Automatic update from web-platform-tests Make SelectMobileDesktopParity WPTs non-tentative Now that the spec PR has been merged, we can remove tentative from these tests: whatwg/html#11460 This patch also adds another test to make sure that <select size=2> is rendered as a listbox instead of a drop-down box. Bug: 439964654 Change-Id: I08cc9b0ddc6940f1c42c0680e033b5ed1df5d09f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7682757 Reviewed-by: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Reviewed-by: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1608215} -- wpt-commits: ecc460f6fc45a3da33e3ac9add74b584b845608a wpt-pr: 58895
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 )