Re: Definition of Identifier?

On Friday 2010-06-25 20:37 -0700, Garrett Smith wrote:
> IS "--" a valid identifier?

Looks like the grammar and the prose disagree here.  I added this as
http://wiki.csswg.org/spec/css2.1#issue-174

I think we should fix the prose to match the grammar.  Gecko and
WebKit both seem to follow the grammar according to this testcase:
http://dbaron.org/css/test/2010/css21-issue-174

> http://www.w3.org/TR/CSS2/syndata.html#value-def-identifier
> 
> | In CSS, identifiers  (including element names,
> | classes, and IDs in selectors) can contain only the
> | characters [a-zA-Z0-9] and ISO 10646 characters
> | U+00A1 and higher, plus the hyphen (-) and the
> | underscore (_); they cannot start with a digit, or a
> | hyphen followed by a digit. Identifiers can also
> | contain escaped characters and any ISO 10646
> | character as a numeric code (see next item). For
> | instance, the identifier "B&W?" may be written as
> | "B\&W\?" or "B\26 W\3F".
> 
> That should that be changed to: "they cannot start with a digit, or a
> hyphen followed by either a digit or a hyphen.

Sounds like the right fix to me.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Saturday, 26 June 2010 16:50:25 UTC