Re: ID Characters (was: Re: 3.4. Global attributes)

On Wed, 01 Aug 2007 00:00:03 +0200, Jim Jewett <jimjjewett@gmail.com>  
wrote:
> Anne van Kesteren wrote:
>> Anyway, they handle it fine. In CSS you might
>> have to escape certain characters because the IDENT
>> production does not always allow them to occur literally.
>
> That is an important enough limit that it should probably be included
> in the good authoring advice, even if not in the actual grammar.
> Perhaps something like:
>
> Authors wishing to write robust applications are advised to use a more
> restricted set of IDs.  While "1" and $^&" are technically valid
> identifiers, they will trigger bugs in some tools.  Therefore, authors
> SHOULD stick to ID characters from the ASCII digits [0-9] and one case
> of ASCII letters (either [a-z] or [A-Z]), and SHOULD ensure that the
> first character of each ID is a letter rather than a digit.
>
> This probably applies to the name attribute as well.

It's not a bug in CSS. You can still select all possible IDs with CSS that  
you can express in HTML 5. It's just that you have to use a slightly  
awkward syntax for some of them. Also, if we're going to give advice for  
features because tools might have bugs in them that would triple the size  
of the specification and not make it very readable. Seems better for  
tutorials to cover such details. (Also, by the time HTML 5 reaches  
recommendation we're supposed to have two _complete_ implementations.)


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Received on Wednesday, 1 August 2007 08:01:53 UTC