Last Comment Bug 27867 - xpconnect does not always work well with DOM objects
: xpconnect does not always work well with DOM objects
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: Trunk
: x86 All
P3 normal (vote)
: mozilla0.9.1
Assigned To: John Bandhauer
: Robert Ginda
: Andrew Overholt [:overholt]
Depends on: 40406
  Show dependency treegraph
Reported: 2000-02-15 13:23 PST by John Bandhauer
Modified: 2001-05-08 11:38 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image John Bandhauer 2000-02-15 13:23:02 PST
Many people have helped a lot to make xpconnect play nice with DOM objects. 
xpcconvert.cpp in xpconnect has code that does its best to wrap and unwrap 
DOM objects used in xpconnect calls. Work was also done to decrease the 
extent to which the DOM makes assumptions about DOM code only being called 
on JSContexts which it created itself. 

But, there remain cases where these two system do not get along...

1) As mscott struggled with recently, xpconnect can not convert a native DOM 
object into a JSObject if neither the static or dynamic scope chain connect to 
any wrapped DOM objects. In his case he had a JS component (xpconnect) code that 
was calling a native service to get the "most recent" nsIWindow (a DOM object). 
XPConnect had no way to access an nsIScriptContext needed in order to get the 
JSObject wrapper from the native nsIWindow object.

2) There remain some methods in the DOM system that will not work properly if 
not called on a DOM JSContext. For instance, tries to use the global 
object of the running JSContext in order to figure out the base URL in 
constructing the absolute URL to open.

Ultimately, I'm afraid that these sorts of issues can not be 100% solved until 
the DOM is converted to use xpconnect rather than the idlc generated code 
Comment 1 User image Brendan Eich [:brendan] 2000-05-24 21:22:23 PDT
We've solved issue #1.  See bug 40406.

Comment 2 User image John Bandhauer 2001-03-15 11:40:34 PST
XPConnect flattening and DOM conversion to use XPConnect is on the way. It may
not fix everything because there will still be JSContexts in the system not
created by the DOM. And I don't think we are going to 'fix' all the code that
tries to determine the "caller window" by looking at the JSContext.
Comment 3 User image John Bandhauer 2001-05-08 11:38:17 PDT
fixed by XPCDOM_20010329_BRANCH landing

Note You need to log in before you can comment on or make changes to this bug.