W3C home > Mailing lists > Public > www-style@w3.org > April 2011

Re: [CSS21] url() and rgb() parsing

From: L. David Baron <dbaron@dbaron.org>
Date: Fri, 22 Apr 2011 20:32:46 -0700
To: Peter Moulder <peter.moulder@monash.edu>, www-style@w3.org
Message-ID: <20110423033246.GA20000@pickering.dbaron.org>
On Saturday 2011-04-23 12:34 +1000, Peter Moulder wrote:
>   - The core grammar differs from the (non-normative) CSS 2.1 grammar
>     on this point.
> 
>   - Most user agents I tested (probably stable/older versions) follow
>     the core grammar here, and hence fail that test case.
> 
>     An exception is Gecko, but that's only because Gecko doesn't have
>     correct tokenization behaviour for URI generally: Gecko still uses
>     a FUNCTION token to handle url(...), but a result of this is that
>     it does the wrong thing for url(/*blah*/x.png), treating /*blah*/
>     as a comment rather than part of the URI.

That's fixed in Nightly and Aurora channel builds (for Firefox 5),
as described in https://bugzilla.mozilla.org/show_bug.cgi?id=604179 .

> The prose describing rgb() syntax is misleading, too: it says
> 
>   # The format of an RGB value in the functional notation is 'rgb('
>   # followed by a comma-separated list of three numerical values
>   # (either three integer values or three percentage values) followed
>   # by ')'.  [...]  White space characters are allowed around the
>   # numerical values.
[...]
> I'd suggest mentioning FUNCTION token somehow, and I'd suggest
> inserting "(and/or comments)" when mentioning white space.
> (I'd be inclined to remove the word "characters".)

As you say, it should mention an "rgb(" function token, where
function token is a link to a description of what constitutes a
function token with a particular name.  In addition to the point you
mention and the escaping issue, this should also mention the
case-insensitivity.

> (Regarding whether to mention comments: I grant that syndata.html
> already mentions that comments can occur outside of any other tokens --
> which is why I parenthesized that note.  However, just because the
> grammar allows comments everywhere doesn't mean that they never change
> the meaning, e.g. in the case of @charset.

I think the wording on comments being allowed anywhere should
probably be the place that has the explicit exception for @charset.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Saturday, 23 April 2011 03:33:15 GMT

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