Re: [CSSWG] Release Candidate for CSS Namespaces Test Suite

On Tue, 29 Sep 2009 15:11:39 +0200, Leif Halvard Silli  
<xn--mlform-iua@må> wrote:
>    In pointing to that grammar, do you then refer to the following 3  
> lines - or do you also refer to something more than that in that  
> grammar? The 3 lines:
>      universal
>        : [ namespace_prefix ]? '*'
>        ;

The point of these lines is that the namespace_prefix is tied to the *. If  
you omit the * you cannot use the namespace_prefix.

>    If this is all you refer to, then please note that the  
> [namespace_prefix] is a 0 or 1 option. And that there are no special  
> rules defined here w.r.t. whether there is - or isn't - a namespace  
> prefix. Thus, if these 3 lines are all that you refer to, and if your  
> reading of the rule is correct, then we would also have to conclude that  
> the following example, which is based on an example from the Universal  
> selector section - and which the draft   directly says is _legal_ [see  
> below], actually is illegal:
>    [hreflang|=en]{color:lime}
>    And thus, if this is the case - if the grammar says that this rule is  
> wrong, then the grammar is not in tune with the prose of the draft - or  
> with common implementations either.

The grammar does allow this and the prose does too. See the  
simple_selector_sequence production.

> Let me go through what the prose says:
>    The prose says []:
>      "If the universal selector is not the only component of
>       a sequence of simple selectors, the * may be omitted."
>      Examples:
>      *[hreflang|=en] and [hreflang|=en] are equivalent,
>      [ snip ]
>    The logical conclusion to this is that [hreflang|=en] is - in fact -  
> a universal selector. Because, according to CSS 2.1, every simple  
> selector is either a universal selector or type selector  
> [].

Please read it all: "The universal selector, written as an asterisk (*  
U+002A), represents the qualified name of any element type." It is not  
needed for the non-namespace cases.

>    The next section of CSS3 selectors talks about universal selectors  
> and namespaces []. All of the  
> examples in that section types the "*" directly - but we cannot conclude  
> from that, that the "*" _has_ to be typed directly.
>    Here are the example section in full:
>      ns|* all elements in namespace ns
>       *|* all elements
>        |* all elements without a namespace
>         * if no default namespace has been specified, this
>           is equivalent to *|*. Otherwise it is equivalent
>           to ns|* where ns is the default namespace.
>    Here it is said that "*" is equivalent to "*|*". The logical  
> conclusion is "*|*" and "*" are equivalent also when the universal  
> selector is omitted.

No, that is reading between the lines. (And contrary to the grammar.) Your  
further examples seem all along the same lines of not reading the  
specification literally and trying to infer things that are not there.

Anne van Kesteren

Received on Tuesday, 29 September 2009 13:25:00 UTC