On 10/24/2012 4:04 PM, Robert O'Callahan wrote: > On Sat, Oct 20, 2012 at 9:55 AM, Boris Zbarsky <bzbar...@mit.edu> wrote: > >> Do we have a plan for adoptNode? If we're allocating nodes out of the JS >> heap, presumably we'll need to brain-transplant the JSObject and then copy >> over the implementation into the new compartment... and make sure we update >> any pointers to the implementation, right? >> > > Couldn't we replace the original with a proxy that forwards to the new > object? It would get a bit complex if the node is adopted many times, but > seems like it ought to work.
Yes, that's effectively what we do in Gecko today. Different window, different compartment, so a reference to something in your own window's document will turn into a cross compartment wrapper after being moved (or adopted) into another window. > Rob > -- jst _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo