T
Thomas 'PointedEars' Lahn
Daniel said:Thomas said:Chances are that Prototype.js uses document.links or a similar NodeList
in a closure and adds event listeners with scripting. The uncleaned
circular references to the NodeList or an element of that list would
leak memory in IE. That effect could then only be observed if the
event target results in an element of such a NodeList, i.e. if you make
that possible by adding the `href' attribute.
This is nothing but conjecture, of course. Only a look at the source
code can provide a definitive answer. [...]
[...] Your explanation seems to indicate that when the tag in question is
a link, that something in the library might add an event to the
document.links list, and that event would leak. However, I'm seeing the
opposite - when the tag is a link, it *doesn't* leak. It's only when it
isn't a link that the leak occurs.
There is nothing that could prevent Prototype.js from handling the opposite
case. Maybe in order to fix these "links" with scripting; who knows.
Something else occurred to me, too... doesn't IE6 have a document.all
NodeList in any case?
Yes; that is even implemented as a collection and a method.
So why would it matter if it's a link or not?
Probably it matters more here if it isn't.
I double-checked the Prototype source code and the word "link" doesn't
occur anywhere inside it, so it isn't doing anything with document.links
(and neither am I)...
Tough luck. But as I mentioned before, there are several ways to make
references to element objects.
Unfortunately, I'm not very much inclined to dig through Prototype.js or
code that uses it. At least not for free, as that would mean sacrificing my
sparse leisure-time in order to support junk.
PointedEars