W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2018

Re: [csswg-drafts] [selectors-4]Why "Pseudo-elements cannot be represented by the matches-any pseudo-class"?

From: SelenIT via GitHub <sysbot+gh@w3.org>
Date: Fri, 09 Feb 2018 11:48:44 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-364413072-1518176923-sysbot+gh@w3.org>
@tabatkins I don't say that elements and pseudo-element are _fundamentally_ different, and I like your interpretation of the `::` syntax as a "combinator", but in the same time I tend to see them as something conceptually close (though not the same, of course) to the elements from a different namespace. It's based on the fact that the usual universal selector (`*`) doesn't select pseudo-elements by default, so we have to list them explicitly like `*, *::before, *::after` (this is quite popular, for example, for changing the default `box-sizing` to `border-box` globally). And I assume that `:matches()` is equivalent to `*:matches()`, which leads me to conclusion that `element:matches(::pseudo-element)` should match nothing because a particular element and its particular pseudo-element can't be the same object.

And I like the idea of treating `::` as a combinator! It seems to be consistent with the concept of Shadow DOM combinators. Perhaps only "legacy" pseudo-elements with single colon syntax are the parsing issue in this case?

GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2284#issuecomment-364413072 using your GitHub account
Received on Friday, 9 February 2018 11:49:18 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:24 UTC