[webkit-dev] document()->frame()->script()->globalObject()

Maciej Stachowiak mjs at apple.com
Thu Jul 23 17:33:04 PDT 2009

On Jul 23, 2009, at 5:23 PM, Eric Seidel wrote:

> It seems all lookups of the current globalObject go through the frame.
> document()->frame()->script()->globalObject() is one example.
> Another:
> JSValue toJS(ExecState*, DOMWindow* domWindow)
> {
>    if (!domWindow)
>        return jsNull();
>    Frame* frame = domWindow->frame();
>    if (!frame)
>        return jsNull();
>    return frame->script()->windowShell();
> }
> Why?  Shouldn't the Document know what its JSDOMGlobalObject is,
> regardless of whether its currently in a Frame or not?

The document should probably know its own inner window object, while  
the frame should hold on to the outer window. I'm not entirely clear  
on how the document relates to the code you quoted though.

  - Maciej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090723/7e58fedd/attachment.html>

More information about the webkit-dev mailing list