- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Tue, 31 Jan 2023 13:21:20 +0000
- To: public-css-archive@w3.org
Yeah, it kinda sounds like the specificity problem from #1027. Example:
```css
.a ~~ .b >> .c {}
```
```html
<div class="a" id="a1"></div>
<div class="b" id="b1">
<div class="a" id="a2"></div>
<div></div><div></div><div></div><div></div><div></div><div></div>
<div class="b" id="b2">
<div class="c"></div>
</div>
</div>
```
If we match `.b` as `#b2`, then `.a` must match `#a2`, which means `~~` has 7 hops, and `>>` has 1 hop.
If we match `.b` as `#b1`, then `.a` must match `#a1`, which means `~~` has 1 hops, and `>>` has 2 hops.
The 2nd option seems better, but this means that, in order to know the precedence of a selector, it can't just be matched greedily, all possible matchings need to be considered.
--
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8380#issuecomment-1410343082 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 31 January 2023 13:21:22 UTC