[whatwg] Document's base URI should use the document's *current* address

Ian Hickson ian at hixie.ch
Wed Feb 15 14:31:52 PST 2012

On Wed, 15 Feb 2012, Justin Lebar wrote:
> Hm...maybe you're right.  But then, how do we jive this with "#foo" and 
> "?foo" links, both of which resolve relative to the current URI in both 
> Firefox and WebKit?

We fix the implementations to match the spec. :-)

> >  - It sets "the document's current address" to ".../page.html#foo".
> Well, this is pretty bad.  document.location is the document's current 
> address [1].  So clicking #foo changed document.location from page2.html 
> to page.html#foo, which I certainly wouldn't expect (and does not match 
> implementations).

Seems to me we should change the implementations then. There isn't any 
fundamental difference between linking to #foo and linking to 
page.html#foo if the base URL is page.html, as far as I can tell.

If the implementations can't change, then I'll change the spec, but it 
really seems bad to me that relative URLs will break depending on when 
they are resolved relative to pushState() changes.

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