Conversation
option elements can match :enabled while inside a disabled select, so the option:enabled selectors also need to include select:enabled. More context here: w3c/csswg-drafts#13383
|
Lgtm |
annevk
left a comment
There was a problem hiding this comment.
I think some more blame research is required here. We check disabled state of ancestor optgroup but not select. Why is that? Perhaps an oversight?
This was added in chromium and webkit here, which references the spec:
I blamed the spec, and I got to 80aba5d which didn't seem to cite any reasons. I'll see what tests fail if I make options become disabled when they are in a disabled select, but I anticipate that more changes would be needed to make this work, if we can at all. |
|
When did listbox get added to the spec? One thought I had was perhaps option doesn't look at select because the assumption was you won't see the picker when select is disabled. I can't see this being a behaviour people are relying on? |
|
I think list boxes are about as old as the |
|
I took a closer look at implementing behavior where options become disabled inside disabled selects. Consider the following: <select disabled>
<option disabled>disabled option</option>
<optgroup disabled label=optgroup>
<option>option in disabled optgroup</option>
</optgroup>
<option>option in disabled select</option>
</select>In current behavior, at least in chromium, "option in disabled select" gets selected by default. It could be fairly complicated to preserve this behavior, but we could try. I'd be afraid of breaking sites by changing how this currently works. Does this still seem preferrable to making the change in this PR? |
|
Thanks for looking into it! My inclination would be to distinguish explicitly disabled and disabled and make the pseudo-class use the latter concept. (There might even be precedent for this.) |
option elements can match :enabled while inside a disabled select, so the option:enabled selectors also need to include select:enabled. More context here: w3c/csswg-drafts#13383
(See WHATWG Working Mode: Changes for more details.)
/rendering.html ( diff )