Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

DOMNodeInserted is deprecated in the DOM Level 3 Events recommendation, along with all the other mutation events:

http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeI...

They have been deprecated because they perform poorly:

> Firefox, for example, when it realizes that a mutation event has been turned on, instantly goes into an incredibly-slow code path where it has to fire events at every single DOM modification. This means that doing something like .innerHTML = "foo" where it wipes out 1000 elements would fire, at least 1000 + 1 events (1000 removal events, 1 addition event).

http://lists.w3.org/Archives/Public/www-dom/2009AprJun/0072....

> Mutation Events are widely acknowledged as “slow” in terms of the real performance degradation that occurs on websites that use them heavily for tracking changes to the DOM

http://www.w3.org/2008/webapps/wiki/MutationReplacement



The spec says "A new specification is under development with the aim of addressing the use cases that mutation events solves, but in more performant manner." so hopefully it won't be too hard to port things like this over... I hope so anyway, because the mutation events are mighty handy!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: