W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2012

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

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 15 Feb 2012 22:31:52 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1202152226110.10315@ps20323.dreamhostps.com>
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.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 15 February 2012 14:31:52 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:40 UTC