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

On 26.04.2011 18:14, Boris Zbarsky wrote:
> On 4/26/11 12:03 PM, Julian Reschke wrote:
>> <base href="data://foo/bar?baz#qux">
>> <a href="taco.html">hello</a>
>> <script>
>> alert(document.getElementsByTagName('a')[0].href)
>> </script>
>>
>> The results are:
>>
>> A: Firefox 4, IE 9: ignore the <base> element, and resolve "taco.html"
>> against where the document was served from
> ...
>> - This is an edge case; unless I'm missing something, using "data:" as a
>> base URI is meaningless. This is what FF and IE seem to think.
>
> That's not what Gecko thinks.
>
> What Gecko thinks is that this is a URI it can't parse at all as a URI,
> so it ignores the <base>. The reason it can't parse it is that the
> string after "data:" doesn't match the production we expect for a data:
> URI (no comma, for example).
>
> You would get the same effect in Gecko with:
>
> <base href="http://spaces here/">
> <a href="taco.html">hello</a>
> <script>
> alert(document.getElementsByTagName('a')[0].href)
> </script>
>
> (but not if you removed the ' ' in the http URI, note).

OK, so FF ignores the <base> element if it fails to parse the URI.

If I use

   data:text/plain,foo

it should be able to parse it, however I then get

   taco.html

Is this intentional?

>> - There's no interop here at all. So it appears we could recommend
>> something that is actually based by the specs.
>
> Assuming this test is representative. Is it?

Hard to say. More tests are good. Testing valid URIs first is good as well.

Best regards, Julian

Received on Tuesday, 26 April 2011 16:43:09 UTC