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.
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
We solved this problem a different way.
(In reply to comment #2) > We solved this problem a different way. The chosen solution is incorrect.
(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.)
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.
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.