[Bug 24318] Define the Realm of objects

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24318

--- Comment #5 from Boris Zbarsky <bzbarsky@mit.edu> ---
> Or am I completely wrong here?

You're not.

What Gecko implements is that a particular implementation object can specify
which global it should live in by returning some other object whose global
should be used.  For example, nodes return their owner document; documents
return a global stashed on them when they're created.

If an object in Gecko does not specify a global to use, the global that's used
is the global of the getter/method that's returning the object to JS.  So if
you do:

  var r = windowA.document.createRange.call(windowB.document);

we create "r" in the global of window A.

There's one complication here if JS reflections don't have the same lifetime as
the underlying object and the object can be returned from various different
getters/methods.  But that might just be an implementation detail.  Not sure. 
The basic question is what should happen if a preexisting object is stashed
somewhere and then retrieved.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Wednesday, 12 February 2014 21:22:28 UTC