Re: [w3c/webcomponents] [feature request] change when upgrade/connected happens during parsing, so that it is the first event in the following microtask (#787)

> Mutations can happen any time; connected or not.

From my observations in Chrome, `connectedCallback` is only fired for a root node and all of it's children and grand children when the root node is finally placed into a document.

Similarly, all the `disconnectedCallback`s of a root node and all its grandchildren are fired when the root node is removed from the three.

And connectedCallback or disconnectedCallback is not fired for any grandchildren of the root node if the root node is not in a document regardless if grandchildren are added or removed.

On that note, I'd like to observe things in `connectedCallback` and clean up in `disconnectedCallback` because from the behavior I observe, that's how it should be. Otherwise manipulating a tree that isn't in the document would be expensive if we were calling all connected and disconnected callbacks.

So the same sort of concept can apply to a `childConnectedCallback`/`childDisconnectedCallback` concept, and doing it in the constructor feels like the wrong way to do it.

-- 
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/787#issuecomment-459047054

Received on Wednesday, 30 January 2019 18:06:03 UTC