Bugzilla – Bug 16638
Define who owns what with MutationObserver
Last modified: 2012-11-09 18:59:57 UTC
Should MutationObserver own the nodes it is observing?
I think not. If JS doesn't have a pointer to the node, it can't
But if the original observe target is deleted, what should happen
to the transient observers? I think they should still work (until the end of
the microtask). That way GC/CC behavior isn't visible to the API user.
Then MutationObserver object itself... I think the only way to hide GC/CC
behavior is to keep MutationObserver object alive as long as
the node(s) it is observing is/are alive.
Yes, that makes sense.
So MutationObserver has weak references to its nodes?
Yes, and nodes have strong references to the MutationObservers which are
Is http://dom.spec.whatwg.org/#garbage-collection correct?
Sounds right to me
Yup, looks ok.