[whatwg] Location object identity and navigation behavior

Bobby Holley bobbyholley at gmail.com
Tue Nov 20 10:40:16 PST 2012


On Tue, Nov 20, 2012 at 9:46 AM, Ian Hickson <ian at hixie.ch> wrote:

> Given the way JavaScript works, I just don't see a sane way to make a
> non-symmetric model work. JS just allows too much introspection. Any time
> you pass a string from one to the other, you're also passing a way for the
> callee to call back into the caller, for example (via the string's
> methods). Passing any sort of structured objects similarly means passing
> mehods. Callbacks are also a very widely used pattern.
>

We actually implement this. It's pretty off-topic for the thread at this
point, but I'd be happy to talk about it in a separate thread or on IRC if
you're interested. I'd also be interested to hear your thoughts about it.

Anyway, we're kind of getting away from the original topic here, which
> isn't fully resolved; Location.
>
> In thinking about this further last night, it struck me that while the
> proposed proxy mechanism was IMHO overly complex, there might be a simpler
> mechanism that still gets all the compatibility needs, and works for
> Mozilla, and isn't quite so crazy. I'm not a huge fan of this, but I'd be
> interested in what Adam thinks of it.
>
> Right now, as specced, each Document gets a Location object, but they all
> act the same: they all work on the active document and they all do
> security checks based on the active document, not the Location's Document.
>
> But what if, instead, we had one Location per Document, and it worked on
> that Document (not the active document), with the security policy being
> like Window, specific to its Document's effective origin, but instead of
> ever getting references to it, you only got references to a proxy that
> acted on the active document's Location?
>

Wouldn't this effectively mean having a LocationProxy, just like
WindowProxy? I'm certainly all for it, and think that it makes things much
more sane, though I don't understand why this wouldn't "propagate the
magic" that Adam doesn't want to propagate. I might be misunderstanding you
though. Can you clarify?



More information about the whatwg mailing list