Bug 27662 - Document needs a JSDOMWindow pointer that doesn't require going through Frame
Summary: Document needs a JSDOMWindow pointer that doesn't require going through Frame
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 27640
Blocks: 26147
  Show dependency treegraph
 
Reported: 2009-07-24 12:14 PDT by Eric Seidel (no email)
Modified: 2011-10-06 01:22 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-07-24 12:14:55 PDT
Document needs a JSDOMWindow pointer that doesn't require going through Frame

This is needed for times in the bindings where we have a Node* or a Document* and we need to get the globalObject so that we can correctly call toJS().

NodeFilterConditionCustom.cpp acceptNode() is one such example.

Relating this to bug 27640 which is the inverse of this mapping.
Comment 1 Loic Dachary 2011-10-05 07:10:53 PDT
Hi,

I think this bug is related to bug 26147 . I'm trying to fix it and I would appreciate if you have an advice on how to proceed. Do you think it should be an additional field to the Document class ? If so do you think it should be set when the Document constructor is called or attached to it later on ? 

There are many approach to this problem and any kind of guidance would be most appreciated. 

Cheers
Comment 2 Adam Barth 2011-10-05 10:38:52 PDT
We solved this problem a different way.
Comment 3 Loic Dachary 2011-10-05 15:10:25 PDT
(In reply to comment #2)
> We solved this problem a different way.

The chosen solution is incorrect.
Comment 4 Eric Seidel (no email) 2011-10-05 15:13:51 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > We solved this problem a different way.
> 
> The chosen solution is incorrect.

Could you provide a bit more context as to what the solution was and why you believe it's incorrect?  (Although I filed this bug, I haven't worked in this area in a long time.)
Comment 5 Adam Barth 2011-10-05 15:15:26 PDT
The reason this bug is invalid is because Document is a DOM-layer object and JSDOMWindow is a bindings-layer object.  It's generally not a good idea to have a DOM-layer object have a pointer to a bindings-layer object.  Instead, we ended up storing the pointer in the JSDocument wrapper object, which is a bindings-layer object.
Comment 6 Loic Dachary 2011-10-06 01:22:15 PDT
Thanks for explaining, now I understand. I'm still unsure if this will help in the context of bug 26147, but it's a different topic.