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

Rethinking the "nature" of pseudo-elements in terms of selector syntax (#5676), a new way to resolve the contradiction came to my mind...

> the descendant combinator (at least in its current whitespace form) _can't_ play with this new chained-combinators feature, or else `.foo > .bar` would suddenly start interpreting as three combinators in a row

What if we declare the whitespaces around combinators other than `::` the optional part of these combinators themselves (i.e., the `>` combinator would be defined as `/\s*\>\s*/` in RegExp terms, and so on, with only `::` remaining `/::/` for compat reasons)?

This change seems to make all the examples above unambiguous and retaining their current meaning: e.g. ` > ` will always remain a single combinator regardless the number of whitespaces around it (unless these whitespaces are separated by an explicit `*`), while ` > ::` will be parsed a sequence of two combinators, ` >` and `::`, leading to insertion of the implicit `*` (by the new rule).

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2284#issuecomment-720190559 using your GitHub account


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

Received on Monday, 2 November 2020 01:30:49 UTC