Re: [selectors] pseudo-element, component of section of simple selectors, simple selector

Daniel Glazman On 09-10-22 17.15:

> Yes, we need a clarification here and I am guilty - loooong ago -
> for that prose.
> The idea behind the prose is that a pseudo-element is a special
> beast for many reasons :
> 
> - first, it's allowed only _once_ and only at the end of the last
>    sequence of simple selectors in a selector
> - second, you can't use it when an element is required, for instance
>    in the Selectors API in a querySelector() call or in an attr()
>    functional notation on the right hand-side of a declaration
> 
> So the correct prose is probably that one :
> 
>    A selector is a chain of one or more sequences of simple selectors
>    separated by combinators. A pseudo-element can be appended to the last
>    sequence of simple selectors in a selector.
> 
> Speaking of clarification, and although that's absolutely obvious to
> everyone here, we could also probably say in the prose that a sequence
> of simple selectors cannot contain more than one type element selector
> or universal selector (possibly ommitted).

Why say 'sequence of simple selectors' if there is only one 
component/simple selector in a particular sequence? To put 
'sequence' last allows singular form: 'simple selector sequence'. 
But why sy 'simple selector' at all if a sequence may contain 
pseudo-elements? I suggest 'selector component' instead. Thus 
'selector component sequence', though one could also interchange 
with 'sequence of selector components'.

Reformulation of your reformulation above -  changes in UPPERCASE:

   A selector CONSISTS of AT LEAST ONE SELECTOR COMPONENT 
SEQUENCE. IF THERE ARE TWO SEQUENCES OR MORE IN THE SELECTOR, THEN 
THEY ARE ALWAYS separated by A COMBINATOR. A SELECTOR COMPONENT IS 
ALWAYS EITHER A SIMPLE SELECTOR OR A PSEUDO-ELEMENT. A 
pseudo-element can ONLY be appended to the last SELECTOR COMPONENT 
SEQUENCE in a selector.

I'm sure you will not swallow this hole, but at least it indicates 
what I think needs to be said.

   NOTES:

* I say 'selector component sequence' instead of 'sequence of 
simple selectors' to have a wording that 100% covers both 
pseudo-elements and simple selectors. The draft already uses 
'component' without a proper definition, though there is a slant 
towards defining 'component' as 'simple selector'.
* If there is just one sequence in the selector, then there is no 
chain of sequences ... So I dropped 'chain'.
* If there is just one sequence, then there also isn't any 
combinator. So I have one sentence dealing with "at least one 
sequence" and another one dealing with "two or more sequences".
* The draft also says that a future specification/version may 
allow several pseudo-elements. I guess one would then add a 
pseudo-element to a preceding pseudo-element? If we say "sequence 
of selector components", then we cover the option that a 
pseudo-element might be added to a preceding pseudo-element.
* With a definition like this, then fantasai does not need to call 
out pseudo-elements in the definition of when * may be dropped. [1]

[1] 
http://dev.w3.org/cvsweb/csswg/selectors3/Overview.html.diff?r1=1.46&r2=1.47&f=h

With regards,
leif halvard silli

Received on Thursday, 22 October 2009 16:45:13 UTC