Re: [csswg-drafts] [selectors-4] Should :user-valid and :user-invalid apply to form and fieldset elements? (#9257)

I think I have a slight preference for making `form` / `fieldset` never match these. The code tracking these in gecko is not amazing, I'm not excited about making it more complicated, and I've never seen a use case for these... But if there are use cases that need this I'd be ok supporting these.

I don't think it's fine to make these effectively `:has(:user-valid)` / `:has(:user-invalid)`, however. That allows a form / fieldset to match _both_ at the same time. Probably should be:

 * `:user-invalid` matches if there's at least one `:user-invalid` associated element underneath.
 * `:user-valid` matches if there's at least one `:user-valid` associated element underneath _and_ there are no `:invalid` elements underneath or so (so `:valid:has(:user-valid)`?)

-- 
GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9257#issuecomment-1700531970 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 31 August 2023 07:45:51 UTC