-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Editorial review: Document customizable <select> elements #38470
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
Editorial review: Document customizable <select> elements #38470
Conversation
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.
@chrisdavidmills I have gone through this, but was exhausted by the end, so might have got sloppy. There's a lot here - looks good.
One thing that I don't think was covered is the stuff in the explainer around default aria stuff. Might not be needed, but worth a quick re-read to see if there is something to be said.
The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677}
The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677}
The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677}
The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677}
files/en-us/learn_web_development/extensions/forms/customizable_select/index.md
Outdated
Show resolved
Hide resolved
files/en-us/learn_web_development/extensions/forms/customizable_select/index.md
Outdated
Show resolved
Hide resolved
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.
@chrisdavidmills Thanks for this. I've reviewed your fixes and I think they are good. Added a few more comments but I don't want to block you merging this when you have looked at them so approving.
Note, I didn't look in detail at everything again. There is a lot here and many eyes have been over it.
I believe all those issues have been addressed.
Nice one @hamishwillee — thanks for the excellent review! |
…, a=testonly Automatic update from web-platform-tests Don't make a11y mappings for ::checkmark The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677} -- wpt-commits: 02363c922be2f833803a8bd2150a7b18c57192d2 wpt-pr: 51585
Yay! |
…, a=testonly Automatic update from web-platform-tests Don't make a11y mappings for ::checkmark The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677} -- wpt-commits: 02363c922be2f833803a8bd2150a7b18c57192d2 wpt-pr: 51585
…, a=testonly Automatic update from web-platform-tests Don't make a11y mappings for ::checkmark The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677} -- wpt-commits: 02363c922be2f833803a8bd2150a7b18c57192d2 wpt-pr: 51585
* Document customizable <select> elements * fix typo * Finish guide * correct info about how <selectedcontent> is populated * add links to customizable select guide, update existing pages, remove unneeded links * Document selectedcontent element * Add doc for ::picker() * Document appearance: base-select, tweak :open and :checked ref pages * Document the ::picker-icon and ::checkmark pseudos * Add notes on implicit popover-invoker relationship and anchor reference * Add default picker styling info, tweak other info * Fixes for josepharhar review comments * Fixes for josepharhar review comments * Fixes for scottaohara review comments * Accessibility and <select> content fixes * Additional fixes * Additional fixes * Additional fixes * Fixes for hamishwillee review comments * Change other elements back to other content * Last few tweaks from hamishwillee review
…, a=testonly Automatic update from web-platform-tests Don't make a11y mappings for ::checkmark The ::checkmark pseudo-element has its contents populated via the content property. The value of the content property can have an additional argument provided to set the accessible name, which we currently set to an empty string by default to hide it from the a11y tree. The value isn't important because I think the checked state of the option element is already provided in a different way, and announcing a checkmark icon is not helpful. Based on this discussion, we should do this by default for the ::checkmark pseudo without requiring the author to also set the accessible name to the empty string: mdn/content#38470 (comment) Fixed: 405946933 Change-Id: I983b1e7dff879f2c1a2184c505046d0581f93380 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6388535 Reviewed-by: Aaron Leventhal <[email protected]> Commit-Queue: Aaron Leventhal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1437677} -- wpt-commits: 02363c922be2f833803a8bd2150a7b18c57192d2 wpt-pr: 51585
* Document customizable <select> elements * fix typo * Finish guide * correct info about how <selectedcontent> is populated * add links to customizable select guide, update existing pages, remove unneeded links * Document selectedcontent element * Add doc for ::picker() * Document appearance: base-select, tweak :open and :checked ref pages * Document the ::picker-icon and ::checkmark pseudos * Add notes on implicit popover-invoker relationship and anchor reference * Add default picker styling info, tweak other info * Fixes for josepharhar review comments * Fixes for josepharhar review comments * Fixes for scottaohara review comments * Accessibility and <select> content fixes * Additional fixes * Additional fixes * Additional fixes * Fixes for hamishwillee review comments * Change other elements back to other content * Last few tweaks from hamishwillee review
Description
Chrome 134 supports customizable
<select>
elements (see https://chromestatus.com/feature/5737365999976448).This includes a multitude of sub-features, which are as follows:
<selectedcontent>
element mirrors the currently-selected<option>
contents. This is the content visible inside the closed<select>
element, otherwise known as the select<button>
.::picker(select)
pseudo-element, which targets the entire contents of the select drop-down menu, otherwise known as the picker.appearance
property valuebase-select
, which opts the<select>
element and the::picker(select)
pseudo-element into the browser-defined default styles and behavior for customizable select.:open
pseudo-class, which can now target the select<button>
when the picker (::picker(select)
) is open.::picker-icon
pseudo-element, which targets the picker icon inside the select<button>
— the little down-facing arrow on the inline-end side.:checked
pseudo-class, which can now target the currently-selected<option>
element.::checkmark
pseudo-element, which targets the checkmark placed inside the currently-selected<option>
element to provide a visual indication of which one is selected.In addition, the select
<button>
and the picker have the following behavior assigned to them automatically:<button>
via CSS anchor positioning.This PR aims to document all of the above new/updated features, and:
<select>
s.Motivation
Additional details
Related issues and pull requests
Fixes #37857
BCD: mdn/browser-compat-data#26171