You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-forms-1] Apply display-visibility to hide unchecked options inside <selectedcontent> #14941
For multi-select, the <selectedcontent> element clones all of the <option>s of the element, and "and by default only the copies that match :checked are rendered".
(See HTML definition and rendering.)
This is currently implemented using the display property. However, like the [hidden] attribute previously, this creates a cascade hazard: if the author tries to select <option> to change its display type (for example, option { display: grid; }), this will cause the unselected <option> elements to all appear inside <selectedcontent>.
We recently adopted a new display-visibility property to be able to sidestep such cascade hazards. Let's use it for selectedcontent > option. This will solve the cascade hazard, and by doing so will not only greatly improve usability for authors, but may even make it possible for us to adopt the <option>-cloning model into single-select.
Reacted by Tab Atkins-Bittner, Psychpsyo (Cameron) and Bramus
Like the discussion we had about relying on a notional currentBackgroundColor for ::picker() colors, I think we should get display-visibility fully specified, implemented, tested, and reviewed by ARIA, TAG, etc. before we make any decisions on where to start relying on it.
Besides the author hazard, is this intended to make it so that the width of the select element can be consistent regardless of whichever option(s) are selected? I still kind of think that we should re-enable intrinsic inline sizing for base appearance select elements with no author replaced button so the width thing in my previous sentence also works for the no author button case: #11838 (comment)
Activity
astearns commentedon Dec 3, 2026
Like the discussion we had about relying on a notional currentBackgroundColor for ::picker() colors, I think we should get
display-visibilityfully specified, implemented, tested, and reviewed by ARIA, TAG, etc. before we make any decisions on where to start relying on it.josepharhar commentedon Dec 4, 2026
Sounds good to me.
Besides the author hazard, is this intended to make it so that the width of the select element can be consistent regardless of whichever option(s) are selected? I still kind of think that we should re-enable intrinsic inline sizing for base appearance select elements with no author replaced button so the width thing in my previous sentence also works for the no author button case: #11838 (comment)