| Summary: | Elements with :has(+ sibling) selectors do not update when their siblings change | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | tlf | ||||
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | NEW --- | ||||||
| Severity: | Normal | CC: | benjamin.mark.adam, heycam, karlcow, koivisto, ntim, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Mac (Intel) | ||||||
| OS: | macOS 13 | ||||||
| Attachments: |
|
||||||
|
Description
tlf
2023-09-08 19:56:02 PDT
I think we'd either need to extend the "invalidate a lot" patch I have in https://bugs.webkit.org/show_bug.cgi?id=253944 to handle such selectors, or (and this is probably better) we need to store :has(+) and :has(~) rules separately on RuleFeature / StyleScopeRuleSet, then look at the style relation bits that we set on elements to determine whether we need to invalidate those rules on some or all of the siblings of the inserted or removed element. Also running into this problem. Here is an example https://o4zyd0.csb.app ... The app has the styles #form-fields:not(:has(li)) ul, #form-fields:not(:has(li)) button { display: none; } but when the form field is added to the fieldset, the query does not match (however subsequent updates to the dom are fast and work). It would good to write a web-platform-test for this if you have time: https://github.com/web-platform-tests/wpt That would help us fix it. |