[CSS21] The grammar of url() token

In [CSS21, 4.3.4 URLs and URIs][1]:

> Some characters appearing in an unquoted URI, such as 
> parentheses, commas, whitespace characters, single quotes (') 
> and double quotes ("), must be escaped with a backslash so that 
> the resulting URI value is a URI token: '\(', '\)', '\,'.

### Issue 1 ###

The prose should provide some reasons for escaping ',' with a backslash.
An implementor needs to know the rationale and the intent for that.

### Issue 2 ###

Backslash character itself should be also escaped with an another
backslash, and that fact should be mentioned explicitly.

As a result of the above,

### Issue 3 ###

In [CSS21, G.2 Lexical scanner][2]:

>  url ([!#$%&*-~]|{nonascii}|{escape})*

This production does not exclude comma or backslash from the range of
characters allowed in unquoted URI. Probably, it should look like:

>  url ([!#$%&*+\--\[\]-~]|{nonascii}|{escape})*

(not sure, I'm not familiar with Flex).


[1]: http://www.w3.org/TR/2007/CR-CSS21-20070719/syndata.html#uri
[2]: http://www.w3.org/TR/2007/CR-CSS21-20070719/grammar.html#scanner

-- 
Andrei Polushin

Received on Thursday, 21 February 2008 13:07:40 UTC