[csswg-drafts] [selectors-4] Consider disallowing :scope inside :has() (#7211)

byung-woo has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors-4] Consider disallowing :scope inside :has() ==
`:scope` inside `:has()` is related to these two issues:
* Consider removing the `:scope` dependency from the relative selectors definition ([issue 6399](https://github.com/w3c/csswg-drafts/issues/6399))
* Consider disallowing the logical combinations pseudo classes inside `:has()` ([issue 6952](https://github.com/w3c/csswg-drafts/issues/6952))

According to the current definition of [absolutizing a relative selector using `:scope`](https://www.w3.org/TR/selectors-4/#absolutizing), these 3 selectors are identical.
* `.b:has(.a :scope .c)`
* `.b:has(:is(.a :scope) .c)`
* `.a .b:has(.c)`

As pointed at the previous issues ([issue 6399](https://github.com/w3c/csswg-drafts/issues/6399), [issue 6952](https://github.com/w3c/csswg-drafts/issues/6952)),
1. `:is()` inside `:has()` increases invalidation complexity,
2. the compound selector in the left side of the `:scope` inside `:has()` creates exactly same problem that `:is()` inside `:has()` creates,
3. we don't need to use `:scope` inside `:has()` because there can be much simpler expression.

How about avoiding this confusion by disallowing `:scope` inside `:has()`?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7211 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 12 April 2022 12:24:47 UTC