Subj : Re: Sharing Javascript objects between different XUL windows. To : Peter Wilson From : Brendan Eich Date : Thu Dec 30 2004 01:07 pm Peter Wilson wrote: > Somehow we have two different instances of the same DOM Element (see > below). > I tried QueryInterface to nsISupports: they are different objects. > > Interestingly, as well as the same siblings, parent etc. the two objects > share the same attributes. I can set an attribute on one and read it > back by the other. Very odd. Taking this to m.dom for now, cc'ing likely helpers. > This happens even though I am not mutating the DOM in question. Could GC > be causing this problem. The DOM is shared between different forms. > I am also experiencing occaisional crashes. > > Is there any way to turn off GC from the Firefox command line to see if > this eliminates the problem? No, but first let's verify that GC is happening in a way that could cause the problem. Can you run a debug build? > > 0001: theTreeSrcNode === srcNode > $[2] = [boolean] false > 0001: theTreeSrcNode.previousSibling === srcNode.previousSibling > $[3] = [boolean] true > 0001: srcNode.id > $[6] = [string] "content-1" > 0001: theTreeSrcNode.id > $[7] = [string] "content-1" > 0001: theTreeSrcNode == srcNode > $[8] = [boolean] false > 0001: theTreeSrcNode.QueryInterface(Components.interfaces.nsISupports) > $[9] = [XULElement] [class: XULElement] {0} > 0001: srcNode.QueryInterface(Components.interfaces.nsISupports) > $[10] = [XULElement] [class: XULElement] {0} > 0001: srcNode.QueryInterface(Components.interfaces.nsISupports) == > theTreeSrcNode.QueryInterface(Components.interfaces.nsISupports) > $[11] = [boolean] false > 0001: theTreeSrcNode.setAttribute("TEST","TESTVal") > $[12] = [void] void > 0001: theTreeSrcNode.getAttribute("TEST") > $[13] = [string] "TESTVal" > 0001: srcNode.getAttribute("TEST") > $[14] = [string] "TESTVal" .