[whatwg] Location object identity and navigation behavior

Bobby Holley bobbyholley at gmail.com
Thu Nov 8 10:19:02 PST 2012


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?

Cheers,
bholley

[1] http://people.mozilla.org/~mwobensmith/window_test/doc_win.htm
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=808608
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=808608#c8


More information about the whatwg mailing list