Conversation
changed empty, now it uses destroy to clean every children tree
this change need a check on destroy, because childNodes returns
textNodes
on dispose i removed the _fireEvent reference breaking the circular
reference and allowing the gc to clean up the memory (tested with
sIEve-0.0.8)
set('html',...) don't leak but set('text',...) does, so added a
Element.Properties.text setter and done empty() before setting the text
I setup a test page that creates 1000 divs, added these divs to the
body and then use empty(), set('html', ...) and set('text', ...) to get
rid of them, causing a 1000 element leak,
with these changes I managed to drop the leaks from 1000 to 0.
This reverts commit 4c68d39.
This reverts commit 14f5deb.
revert dispose, destroy now filter nodeType, so Element.properties.text can use empty without throwing errors, delete properties in clean.
There was a problem hiding this comment.
had to check for existence because otherwise IE throw some nasty error. (Object doesn't support this action)
There was a problem hiding this comment.
do you know why clearAttributes doesn't handle this, or is it because those things begin with $ or _?
There was a problem hiding this comment.
http://msdn.microsoft.com/en-us/library/ie/ms536350(v=vs.85).aspx
The clearAttributes method clears only persistent HTML attributes. The ID attribute, styles, and script-only properties are not affected.
There was a problem hiding this comment.
It's still weird though.. because all other methods are added with Object.append as well, which boils down to simply element.set = function.... So why do you have to delete _fireEvent manually, but not any other method..
There was a problem hiding this comment.
"Object doesn't support htis action" is still thrown at "delete item[property]" in IE8.
|
@kentaromiura it's been a while, but could you rebase this. I'd also be interested in the Spec. I wonder how we could incorporate memory usage (leak) with our test processes. |
changed empty, now it uses destroy to clean every children tree
this change need a check on destroy, because childNodes returns
textNodes
on clean i removed the _fireEvent reference breaking the circular
reference and allowing the gc to clean up the memory (tested with
sIEve-0.0.8)
set('html',...) don't leak but set('text',...) does, so added a
Element.Properties.text setter and done empty() before setting the text
I setup a test page that creates 1000 divs, added these divs to the
body and then use empty(), set('html', ...) and set('text', ...) to get
rid of them, causing a 1000 element leak,
with these changes I managed to drop the leaks from 1000 to 0.