W3C home > Mailing lists > Public > public-iri@w3.org > May 2011

Re: Non-hierarchical base URLs (was Re: draft-abarth-url-01 uploaded)

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 03 May 2011 13:31:59 -0700
Cc: public-iri@w3.org
Message-id: <7E422CCD-9C6E-4F37-BC7A-DDCF50988811@apple.com>
To: "Roy T. Fielding" <fielding@gbiv.com>

On May 3, 2011, at 12:24 PM, Roy T. Fielding wrote:

> On May 3, 2011, at 11:00 AM, Maciej Stachowiak wrote:
>> My example was meant to illustrate a case where relative resolution against a non-hierarchical URI scheme may actually come up in Web content. I draw no conclusions about whether any specific behavior is required for Web content. Although testing 5 browsers and getting 4 different answers implies to me that we really need a clearly defined behavior for this case. If you would like to see an example of relative resolution against a non-hierarchical URI that has full interop, try this:
>> <iframe id=foo src="about:blank" onload="test()"></iframe>
>> <script>
>> var doc = document.getElementById("foo").contentDocument;
>> var anchor = doc.createElement("a");
>> anchor.setAttribute("href", "foo.html")
>> doc.body.appendChild(anchor);
>> alert(anchor.href);
>> </script>
>> I believe you will consistently get resolution against the URL of the parent document. I am reasonably confident cases like this *do* affect Web compatibility, though the deviation here is outside the scope of URL parsing itself.
> Color me confused.  I have never seen actual (non-test) content
> on the Web that has an arbitrary base URI (one that is unusable
> in practice).  What is the use case?  Is this a javascript idiom
> that I am not familiar with?

In the test case quoted above, "about:blank" is a real URI that actually gets loaded. It neither arbitrary nor unusable.

Received on Tuesday, 3 May 2011 20:32:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:39:42 UTC