[whatwg] URL resolution of fragment urls in html5 webapps

Ian Hickson ian at hixie.ch
Wed Sep 11 11:22:09 PDT 2013

On Wed, 11 Sep 2013, Anne van Kesteren wrote:
> On Tue, Sep 10, 2013 at 8:34 PM, Ian Hickson <ian at hixie.ch> wrote:
> > On Wed, 10 Jul 2013, Rafael Weinstein wrote:
> >> I'm curious: Is it useful to have fragment URL resolve against 
> >> anything other than the "display" url? I.e. when is the current 
> >> behavior wrt fragments appropriate.
> >
> > It's a good question. I thought the old IETF specs for URLs said you 
> > had to do otherwise, but nobody seems to have implemented that.
> Browsers have been inconsistent on this actually, not sure if they still 
> are. I think if we want to do this differently, then after trimming 
> whitespace to obtain the URL, the <a> element should have a special case 
> for # and pick a different base URL at that point.
> https://tools.ietf.org/html/rfc2396#section-4.2 has the vague wording 
> that does not take the base URL into account. In 
> https://tools.ietf.org/html/rfc3986#section-4.4 it does. The problem 
> with the former is that it's not clear when it applies, but we could 
> make that clear by only doing it in certain contexts, as I suggested 
> above.

Well presumably we wouldn't want to only do it for <a>, since then links 
would work but SVG wouldn't (the exact opposite of the situation in Chrome 
now, for what it's worth).

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list