W3C home > Mailing lists > Public > www-style@w3.org > March 2009

[css21] CSS URL handling

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 24 Mar 2009 17:20:51 +0100
To: www-style@w3.org
Message-ID: <op.ura0010c64w2qv@annevk-t60.oslo.opera.com>
Back in 2005 IRIs were discussed on this list and I did not quite get what  
Björn meant back then due to not understanding Unicode Normalization very  


Anyway, four years forward and URL handling in CSS is still undefined.

I did some testing today and CSS handling of URLs appears identical to  
HTML handling of URLs in browsers, except that the query component is  
always encoded in UTF-8 and not dependent on the encoding of the CSS  
document (or HTML document for that matter). (How browsers work follows  
the "convential wisdom" Björn describes rather than RFC 3987, by the way.)

HTML URL handling is currently detailed by HTML5 but will likely be split  
out by Dan Connolly into a separate draft. I suppose it's best to wait and  
reference that draft when it is ready. We also need to make some textual  
changes of course to say what happens when the URL cannot be resolved,  
that the URL character encoding is always UTF-8, etc.

The difference from referencing the IRI specification is that 1) URLs  
found in non-Unicode encoded documents are not normalized to NFC and 2) it  
actually deals with URL strings such as url("image.php?name=CAT HAZ  
BURGER") (i.e. that contain illegal characters).

(There are some small interop issues. IE6 (not sure about newer versions)  
sends the query string as raw UTF-8 bytes rather than having them  
percent-escaped. WebKit normalizes text encoded for sending out to NFC,  
which includes url() in CSS as it happens.)

Anne van Kesteren
Received on Tuesday, 24 March 2009 16:21:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:27 UTC