Re: [css21] whitespace in URI values

On Saturday 12 November 2005 11:47, Anne van Kesteren wrote:
> On Sat, 12 Nov 2005 05:52:50 +0100, Boris Zbarsky <bzbarsky@mit.edu> 
wrote:
> >> Which URIs would load if I had:
> >> 1. @import url("\Atest.css");
> >> 2. @import url(" test.css");
> >
> > This is an interesting question, I agree; not really related to the
> > part of Appendix G you quoted, though.
>
> Thanks for the explanation of those rules. It is much clearer now :-)
> And I also understand that this has nothing to do with it. It is what
> is inside that "string" what matters. (I hope someone from the WG can
> answer that question.)

That is correct. The URI *token* in the grammar includes the characters 
"u", "r", "l", "(", ")" and optional white space and quote marks, but 
the actual *URI* represented by that token doesn't. The URI is derived 
from the token by removing those characters, decoding any \-escapes and 
making the URI absolute.

The result may or may not be a valid URI and even if it is syntactically 
valid, it my not resolve to anything. CSS 2.1 doesn't define what 
happens with invalid URIs or URIs that point nowhere.

Thus, the token 'url(   test.css    )' contains the relative URI 
"test.css".

And the token 'url("\Atest.css")' yields an invalid URI, because of the 
line feed character.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Monday, 14 November 2005 13:49:01 UTC