Re: problem with t040103-ident-03-c.htm?

Stewart Brodie wrote:
> fantasai <fantasai.lists@inkedblade.net> wrote:
> 
> It can be done a couple of different ways, I think.  The simplest way to
> change it would be to ensure that idents are no longer valid names.  Change
> the definition of name such that the first character after the optional
> hyphen cannot come from the intersection of nmstart and nmchar.  The way to
> do this would be the same for both specs:
> 
> name       [-]?[0-9-]{nmchar}*
> 
> %%
> 
> "#"{ident}      return HASH
> "#"{name}       return HASHNAME
> 
> 
> and then in the CSS2.1 spec:
> 
> hexcolor:
>     [ HASH | HASHNAME ] S*
> 
> [Actually, it would be better for the CSS2.1 to actually tie down the rules
> for hexcolor to be 1 or 2 instances of a group of three hexadecimal digits,
> but it's probably not worth going to that extreme?]
> 
> There is no ABNF definition (that I can find) for CSS3 colour values in
> either CSS3 Values & Units Module or in CSS3 Color Module: it is merely
> explained in the prose as a hash character followed by 3 or 6 hexadecimal
> digits, so no change would be required there (the parser writer just has to
> find a way of examining the token stream to determine the value)
> 
> Even that is insufficient as web browsers have quirks mode issues where they
> have to deal with a string of hexadecimal characters *without* the leading #
> character!
> 
> Something that looks even simpler, but doesn't work, would be to do without
> the redefinition of 'name', but that would lead to tokenisation problems
> (because all idents are valid names in the existing specs).

Yeah, Bert explained to me afterwards that color vs ID needs to be determined
via context, and this part of the grammer I guess is supposed to be context-free.
I'm not really very clear on these syntax things, I haven't spent much time
on them. Perhaps it would be best to leave the grammar as-is.

> If you don't mind the CSS2.1 and CSS3 Selectors diverging, you could simply
> change the Selectors spec to make the HASH token be "#"{ident} and then
> delete name altogether, since the specification is only concerned with the
> grammar of selectors and then it becomes the Color module's problem.  I'm
> not sure I like the idea of divergence, though.

No, I don't think we want that.

~fantasai

Received on Wednesday, 22 August 2007 17:46:50 UTC