W3C home > Mailing lists > Public > public-html@w3.org > June 2008

Re: expected results for URI encoding tests?

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Fri, 27 Jun 2008 14:17:14 +0100
Message-ID: <4864E85A.2010301@cam.ac.uk>
To: Dan Connolly <connolly@w3.org>
CC: "public-html@w3.org WG" <public-html@w3.org>

Dan Connolly wrote:
> Ian, these test materials look pretty handy...
>   http://hixie.ch/tests/adhoc/uri/encoding/
> 
> but I'm not 100% confident I understand how they work.
> What's the expected result from 0002.html , for example?
> 
> [...]
> 
> Looking at http://www.w3.org/html/wg/html5/#urls ,
> I don't quite see the text that tells me what that
> outcome should be.

The outer page (iso-8859-13) contains an iframe initially set to some 
other page (iso-8859-15). The outer page then sets iframe.src = 
'results.cgi/\u017d?\u017d'.

<http://whatwg.org/html5#src1> says "Whenever the src attribute is set, 
the nested browsing context must be navigated to the given URL".

The steps at <http://whatwg.org/html5#navigate> are run. Step 4 says 
"Resolve the URL of the new resource."

<http://whatwg.org/html5#resolve> refers to "the Document associated 
with url". Since the URL came from a script API, 
<http://whatwg.org/html5#url> says the associated Document is "the 
script's script document context", which is (roughly) the Document the 
script is executing in (assuming there is one; I hope there always is 
one when setting URLs).

(It would be nice if the spec linked the use of 'associated' back to the 
definition.)

Then: Step 7 encodes the <path> as UTF-8. Step 8 encodes the <query> as 
"the character encoding of document", which is iso-8859-13. So the 
encoded relative URL is "results.cgi/%C5%BD?%DE".


IE6, IE7 go to "results.cgi/%C5%BD?*" where "*" means a raw 0xB4 byte 
(i.e. raw iso-8859-15).
FF2 goes to "results.cgi/%DE?%DE".
FF3, Opera 9.5, Safari 3.0 go to "results.cgi/%C5%BD?%DE".

-- 
Philip Taylor
pjt47@cam.ac.uk
Received on Friday, 27 June 2008 13:17:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:18 GMT