Re: parsing issue in the editor's draft of css3-image

On Mon, 20 Jul 2009, Bert Bos wrote:

> On Thursday 16 July 2009, Zack Weinberg wrote:
>> fantasai <fantasai.lists@inkedblade.net> wrote:
>>> Yves Lafon wrote:
>>>> In [1], I found the following example:
>>>>
>>>> background-image: image(wavy.svg, 'wavy.png' 150dpi, "wavy.gif"
>>>> or blue);
>>>>
>>>> Should it be image( url(wavy.svg), 'wavy.png' 150dpi, "wavy.gif"
>>>> or blue); ?
>>
>> ...
>>
>>>> Depending of the intent, it would be good to either add a url()
>>>> or to require quotes.
>>>> Thanks,
>>>
>>> CSS3 modules are not required to conform to the CSS2.1 Appendix G
>>> grammar, only to the core grammar in Chapter 4. Therefore this is
>>> not an issue. A CSS2.1 parser will parse the functional notation as
>>> invalid, which is expected.
>>
>> However, this production introduces another special case in the
>> tokenizer and therefore should, IMO, be changed as Yves suggests
>> anyway.
>
> I agree, but with a small correction:
>
> It doesn't create a special case, but the obligation for an author to
> escape commas and characters that cannot occur in a value, such as
> unbalanced parentheses and semicolons:
>
>    http://example.org/foo?s10,34;x={}
>
> would have to be written as:
>
>    http://example.org/image?s10\,34\;x=\{\}
>
> (This creates some 13 tokens, if I counted correctly.)
>
> I'm all for omitting parentheses and quotes when possible, but for URLs
> I don't think it is possible.

Frankly I can't think of an author escaping URIs that way, see how & are 
not escaped in HTML hrefs... using url() which is an existing construct 
not only gives what is expected but also gives the same user experience 
for authors, ie: "Oh for this property should I use url() or not" is a 
good recipe for errors.

-- 
Baroula que barouleras, au tiéu toujou t'entourneras.

         ~~Yves

Received on Tuesday, 21 July 2009 19:13:21 UTC