Summary: | [:has() pseudo-class] Styles matching non-matching elements on load | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brandon McConnell <brandon> | ||||
Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED DUPLICATE | ||||||
Severity: | Critical | CC: | bramus, koivisto | ||||
Priority: | P2 | ||||||
Version: | Safari Technology Preview | ||||||
Hardware: | Mac (Intel) | ||||||
OS: | macOS 11 | ||||||
Attachments: |
|
Description
Brandon McConnell
2021-12-28 14:32:44 PST
Also check example #'s at this URL (https://codepen.io/brandonmcconnell/pen/a93e58403165e721481e7fc4fe3fb676?editors=1100): * Example 6 * Example 7 * Example 8 Each shows certain matched squares that should not be matched. If you inspect those blocks in the inspector, you will see they are not actually receiving the styles but show them visually anyway. On Twitter I saw a demo pass by that showed the same faulty behavior: https://codepen.io/ZoranJambor/pen/GRMyzvy ``` a:has(span) { background: rebeccapurple; color: #fff; } ``` Both `<a>` elements get styled, even though the 2nd `<a>` element does not contain a `<span>`. Fixed in trunk. *** This bug has been marked as a duplicate of bug 234531 *** |