This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20438 - [Custom]: consider adding "inserted" and "removed" lifecycle methods
Summary: [Custom]: consider adding "inserted" and "removed" lifecycle methods
Status: RESOLVED DUPLICATE of bug 21660
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18511
  Show dependency treegraph
 
Reported: 2012-12-19 00:09 UTC by John Messerly
Modified: 2013-05-08 16:51 UTC (History)
1 user (show)

See Also:


Attachments

Description John Messerly 2012-12-19 00:09:51 UTC
If a component author needs to register an event on something other than their own shadow dom tree (perhaps something global accessed from window, or more likely Object.observe on a JS object), they need a way to unregister the handler so it doesn't leak the handler. Many of the popular web frameworks have some sort of "destory"/"disposable"/"removed" mechanism to help deal with this.
Comment 1 Scott Miles 2012-12-19 00:17:41 UTC
Yes, we have encountered this issue also. To avoid dangling references, a component needs to know when it's inserted/removed from DOM. 

Perhaps an event when parentNode changes?
Comment 2 Dimitri Glazkov 2013-05-08 16:51:37 UTC

*** This bug has been marked as a duplicate of bug 21660 ***