Bug 27662
Summary: | Document needs a JSDOMWindow pointer that doesn't require going through Frame | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | abarth, ap, loic |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 | ||
Bug Depends on: | 27640 | ||
Bug Blocks: | 26147 |
Eric Seidel (no email)
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Loic Dachary
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
Adam Barth
We solved this problem a different way.
Loic Dachary
(In reply to comment #2)
> We solved this problem a different way.
The chosen solution is incorrect.
Eric Seidel (no email)
(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.)
Adam Barth
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.
Loic Dachary
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.