| Summary: | [:has() pseudo-class] in combination with interactive pseudo-class can't be called twice | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jan Nicklas <j.nicklas> | ||||
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED DUPLICATE | ||||||
| Severity: | Normal | CC: | koivisto, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Safari Technology Preview | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
Works correctly with trunk (in form:has(:focus):has(input:not(:focus) the latter :has always matches since there is always an unfocused input in this tree). I think this was fixed after STP 139, maybe in bug 234842. *** This bug has been marked as a duplicate of bug 234842 *** |
Created attachment 450282 [details] Video of the Bug In Safari Technology Preview 139 the :has() selector does not seem to match correctly if the argument is an interactive pseudo-class with the universal selector e.g. :has(*:focus) and is used twice or more times. In the following example the form should receive a red border once an input has focus: <style> form:has(:focus) { background: rgb(255, 246, 167); } form:has(:focus):has(input:not(:focus)){ border: 1px solid red; } </style> <form> <input> <input> </form> I attached a video of the behaviour.