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

On May 3, 2011, at 3:31 PM, Maciej Stachowiak wrote:
> On May 3, 2011, at 3:18 PM, Roy T. Fielding wrote:
>> On May 3, 2011, at 1:31 PM, Maciej Stachowiak wrote:
>>> On May 3, 2011, at 12:24 PM, Roy T. Fielding wrote:
>>>> 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.
>> 
>> Yes, I know what happens in the test case.  What I don't understand
>> is why you think that case is worth testing.  What is the use case?
>> Why would a web page include an iframe that loads "about:blank"
>> (which itself is not interoperable) and then perform a sequence of
>> javascript actions that include a relative reference?
> 
> It is a very common pattern on the web for pages to load an about:blank iframe which is then populated using completely using script - document.write, innerHTML, or other DOM calls. We've had to fix bugs to ensure that relative URLs in such a context resolve against the parent frame's URL as the base.

Okay,  that makes sense, though I would have expected the iframe
to just not have a src attribute.

> Which part are you skeptical about, the fact that about:blank frames are often populated using script from the outside, or that the contents thereby injected would involve resolution of relative URLs? 

I am asking for examples where this is done in practice so that I can
understand why they work the way they do, and thereby produce better
documentation that takes them into account.  I've looked and can't
find them (too many stop words for indices), though there is an
oblique reference on google code about using them for delayed
rendering of maplets.

> Note that the important case here is not dumping the href property of an anchor tag from script, that is just for ease of demonstration purposes. What's important is what happens when you traverse the link, or navigate in other ways such as by assigning the location property.

Yes.

>> I don't have a problem with HTML5 prohibiting the use of certain
>> URI schemes as a base URI, assuming the HTML parsers revert to
>> whatever valid base URI was previously active by context, but
>> I would like to make standards decisions based on real examples.
> 
> If you doubt that about:blank iframes populated with script frequently appear on the Web, then that seems like an undue level of skepticism for someone familiar with real-world web content.

It isn't skepticism.  I have never used such a feature because
I don't know why I would want to -- generally speaking, I prefer
to separate code from markup, I don't use relative references
in code, and I avoid iframes for anything other than analytics.
That doesn't mean it isn't a valid use case -- I just don't know
the use case.

> In any case, this particular issue is not directly relevant to URL parsing (it's already handled by HTML5), so we don't really need to come to a conclusion here. It's only cases where HTML5 does not (and will not) specify an alternate base URL that we need to worry about.

Okay,

....Roy

Received on Wednesday, 4 May 2011 00:01:19 UTC