W3C home > Mailing lists > Public > www-style@w3.org > June 2010

Re: Definition of Identifier?

From: L. David Baron <dbaron@dbaron.org>
Date: Sat, 26 Jun 2010 09:49:54 -0700
To: Garrett Smith <dhtmlkitchen@gmail.com>
Cc: www-style@w3.org
Message-ID: <20100626164954.GA788@pickering.dbaron.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:28 GMT