Re: [selectors4][css-syntax] Pseudo-elements vs. combinators

On Wed, Feb 05, 2014 at 03:55:54AM +0000, Sylvain Galineau wrote:
> ... I have heard a few times: "We should stop adding combinators and use pseudo-elements instead". 
> ...
> One suggestion would be to allow future combinators to be mnemonics or even words; we'd presumably need to agree on a common prefix for them to disambiguate them for elements. 
> So just like
> ::<name> indicates a pseudo-element,
> :<name> indicates a pseudo-class,
> we'd have 
> <combinator-prefix><name> indicate a combinator.

The CSS 2.1 parsing rules (section 4.1.7 paragraph 4 and following) say that if
any comma-separated component of a ruleset's selectors is not valid CSS 2.1,
then the whole ruleset must be dropped.  This seems to be true of css-syntax /
css-selectors-4 too (except that the comma-separated components have slightly
looser requirements than CSS 2.1, e.g. having some additional combinators).

This suggests that the best choice of <combinator-prefix> is actually ‘:’.

(Which almost brings us back to where we started.)


Received on Thursday, 6 February 2014 21:30:25 UTC