Re: [w3c/webcomponents] Need a callback for when children changed or parser finished parsing children (#809)

Let first state that the time at which the parser had finished running isn't a great way to do anything because DOM is inherently dynamic. Any node can be inserted or removed after the parser had finished parsing its contents, not to mention that HTML parser could later insert more children via adoption agency, etc...

The reason we want to add `childChangedCallback` is ergonomics for the same reason we have `attributeChangedCallback` even though attribute changes can be observed via `MutationObserver` as well.

Now, custom elements have unique characteristics that child elements may be dynamically upgraded later so just knowing when a child is inserted or removed may not be enough for a parent element to start interacting with a child element. This is a rather fundamental problem with the current custom elements API. We need some way for a parent to discover a child custom element when it becomes well defined.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/809#issuecomment-488530744

Received on Thursday, 2 May 2019 01:39:07 UTC