ISSUE-67 - Public View

Should resolution of relative URI references sent to location be defined in JS bindings or generally?

State:
CLOSED
Product:
Window
Raised by:
Maciej Stachowiak
Opened on:
2006-04-04
Description:
Assigning a relative URI reference to window.location (or using location.assing() or location.replace()) 
from JS has an odd quirk: the URI is resolved relative to the location of the window currently executing 
code, rather than the location it is actually being assigned to. This is kind of weird, and also doesn't 
make sense for languages other than ECMAScript. I can imagine the following possibilities:

1) Drop this behavior for all languages including ECMAScript, and just always resolve based on the 
location's current URI. This will probably break content - not sure how to tell.

2) Make the general definition be like the current ECMAScript behavior, but I don't know how this could 
work. Other languages wouldn't have a concept of currently executing Window since they do not use 
Window as their global object.

3) Make the general definition resolve with the target location's current href as the base, but 
ECMAScript bindings define a quirk that they use the source window's location instead, if different.

4) Make other languages only accept absolute URIs, and make relative URIs an ECMAScript-only 
extension with the weird ES behavior above.

I would prefer #1 if it were doable, but if that turns out to be too likely to break content then I think #3 
would be a good choice.

Thoughts?

Note: Some of these links may be accessible only to W3C Members.

Related emails:
  1. ISSUE-67: Should resolution of relative URI references sent to location be defined in JS bindings or generally? (from dean+cgi@w3.org on 2006-04-04)
  2. Re: ISSUE-67: Should resolution of relative URI references sent to location =?x-unknown?B?YmXCoGRlZmluZWQ=?= in JS bindings or generally? (from ian@hixie.ch on 2006-04-04)
  3. Re: ISSUE-67: Should resolution of relative URI references sent to location be defined in JS bindings or generally? (from jonas@sicking.cc on 2006-04-05)
  4. Minutes, face to face meeting (from chaals@opera.com on 2006-05-15)

Related notes:

No additional notes.