Description
This issue is for tracking improvements to the :has() page.
Reference: #19572 (comment)
the syntax docs are take a but that is not defined anywhere in our docs. In summary all the "forgiving" bit means is that any of the comma separated selectors are invalid they just get skipped and the selector works on the valid ones.
- This is apparently different to normal list selectors, where if one is wrong the lot get dumped. Not clear if this applies to just when used in a query or in a style sheet.
- the "relative" bit means that the selectors are relative to the element or whatever that this has() was applied to.
The WG just added a new rule that has() pseudo class can't contain a pseudo class of the current types, but may take future types:
[selectors-4] Disallow pseudo-elements inside :has() w3c/csswg-drafts#7463 (comment)
- So we may have to list the cases that can't be used.
- It is not clear whether FF already implements this restriction according to https://bugzilla.mozilla.org/show_bug.cgi?id=418039. I think we need some test code.
The Description from/including "In earlier revisions of the CSS Selectors Level 4 specification, :has had a limitation that it couldn't be used within stylesheets. ..." should be removed. If it wasn't implemented in any browser it is now irrelevant.
The examples are too simplistic - they only show one item - NOT a list. We need a list, and we should also show that the case of an invalid selector is dropped. Ideally in a live example.
Metadata
Assignees
Type
Projects
Status
Archive