Re: Extend use of namespaces

----- Original Message -----
> * Paul Duffin wrote:
> >I don't dispute the initial motivation for adding it but it seems to
> >me
> >that the language used in the specification indicates that
> >considerable
> >thought went into making it suitable for use as a general mechanism
> >for
> >namespacing CSS identifiers in general.
> 
> The character `|` is not allowed as an (unescaped) part of
> identifiers;
> something like `example { example|example: example }` is not parsable
> as
> style sheet under the supposedly set-in-stone core language syntax.

That is a good point. I guess that you are basing that on CSS 2 syntax http://www.w3.org/TR/CSS2/syndata.html#tokenization.

ruleset     : selector? '{' S* declaration? [ ';' S* declaration? ]* '}' S*;
selector    : any+;
declaration : property S* ':' S* value;
property    : IDENT;
value       : [ any | block | ATKEYWORD S* ]+;
any         : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
              | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
              | DASHMATCH | ':' | FUNCTION S* any* ')' 
              | '(' S* any* ')' | '[' S* any* ']' ] S*;

I guess the | used in selectors must be matched by DELIM.

Ok, so based on that syntax we can identify the places where they could be used:
* at-rule name        - not allowed because the name is an IDENT
* property name       - not allowed because the name is an IDENT
* pseudo class name   - allowed as it is a selector and selectors can contain |.
* pseudo element name - allowed as it is a selector and selectors can contain |.
* property value      - allowed because a value can contain DELIM

However, I think that a conforming CSS parser that implements the http://www.w3.org/TR/CSS2/syndata.html#parsing-errors rules properly should simply ignore a | in a property name or at-rule and skip over to the end of the declaration / at-rule respectively. So from that perspective a "CSS qualified name" could be used as a property name or at-rule name.

Received on Friday, 17 September 2010 20:38:39 UTC