mirror of https://github.com/sveltejs/svelte
fix: mark `:has` selectors with multiple preceding selectors as used (#13750)
Fixes #13717 There are two parts to this: 1. the parent selectors weren't passed along for the check inside `:has`, which in case of a leading combinator would mean it would always count as unused 2. In case if a selector like `x > y:has(z)`, the prior logic would correctly determine that for element `z` there's a match for the `:has` selector, by first checking its contents and then walking up the tree. But after it did that, it would try to walk up the tree once more, which is a) wasteful b) buggy because the tree walking mechanism would no longer be adjusted for the `:has` special case, resulting in false negatives. To fix that, the `:has` will return a new value from the function, signaling that it already fully checked the upper selectors, and so the function calling it will skip doing that.pull/13742/head
parent
fd78385447
commit
a6e416da8c
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: mark `:has` selectors with multiple preceding selectors as used
|
Loading…
Reference in new issue