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

On Thu, Feb 6, 2014 at 1:29 PM, Peter Moulder
<pjrm@mail.internode.on.net> wrote:
> 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 ‘:’.

You're misreading that.  It's stricter than you're implying - using an
unknown pseudo-class invokes the "doesn't match the grammar"
condition.

So using : is no safer than using anything else.  (And it's way more
confusing, given the double-duty it's already pulling as an indicator
of pseudo-classes and pseudo-elements.)

The actual restrictions we're working under are just that the new
syntax be compatible with CSS's general syntax, which pretty much only
disallows using {, or using ( without a ).  (We can't use [ in any
case, since it's already used for attr selectors, unless we do
something weird like [[shadow]].)

~TJ

Received on Friday, 7 February 2014 00:52:00 UTC