[whatwg] Location object identity and navigation behavior

James Graham jgraham at opera.com
Fri Nov 9 00:37:25 PST 2012

On 11/08/2012 07:19 PM, Bobby Holley wrote:
> The current spec for the Location object doesn't match reality. At the
> moment, the spec says that Location is a per-Window object that describes
> the associated Document. However, in our testing, it appears that none of
> the user-agents (Gecko, WebKit, Trident, Presto) do this [1]. Instead, all
> implementations of Location describe the active document in the browsing
> context (that is to say, the referent of the WindowProxy). This suggests
> that the spec's current language is likely not web-compatible.
> If the Location object describes the browsing context, we're left to
> consider whether there should be one Location object per Window or one
> Location object per browsing context. Gecko and Webkit currently do the
> former, and Trident and Presto do the latter (see again [1]). I would like
> to change Gecko's behavior here [2], because would simplify a lot of
> security invariants and generally make things more sane. How do WebKit
> folks feel about this?
> If Location follows the WindowProxy, an interesting question is what
> happens to expando properties on navigation. I did some testing, and UAs
> seem to have pretty inconsistent behavior here [3]. As such, I think the
> sanest policy is simply to clear expandos on Location each time the page is
> navigated. This is the approach I've taken in the patches in [2].
> Thoughts?

Nothing specific on the design, but whatever the final consensus here is 
*please* submit your testcases for everyone to use. This stuff is 
difficult, and very hard to write tests for when you are not actively 
implementing. Without a good shared library of tests in this area we 
will probably have bad interoperability for many years to come.

More information about the whatwg mailing list