W3C home > Mailing lists > Public > www-style@w3.org > February 2014

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

From: Peter Moulder <pjrm@mail.internode.on.net>
Date: Fri, 7 Feb 2014 08:29:57 +1100
To: www-style@w3.org
Message-ID: <20140206212957.GA4432@mail.internode.on.net>
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.)

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:18 UTC