[w3c/webcomponents] Consider adding a childrenChangedCallback or something (#619)

Chromium has got feedback from developers (for example Issues [676365,](https://crbug.com/676365) [672732,](https://crbug.com/672732) [658119](https://crbug.com/658119), [639847](https://crbug.com/639847), etc.)  which indicates some confusion about when child nodes are accessible in a custom element's connectedCallback around construction time. Some confusion is probably because Blink had bugs, but this is inherently a bit confusing—sometimes the connectedCallback after upgrade has the child nodes (fragment parsing, upgrade on insertion) and sometimes it doesn't (parsing.)

There's some relevant discussion on Issue 551, which includes the suggestion to add a "children changed" callback.

I suspect some use case elicitation is in order here, for example, I've also heard people discuss a "parser done adding children" callback which is semantically very different to "children changed", and I note mutation observers can observe not just children but also subtrees.

Another idea could be to let MutationObservers have an option to deliver changes at CEReactions time. I haven't really thought hard about the implementation feasibility of this, but it might be worth considering as an alternative to developing callbacks piecemeal, and the dynamism of disconnect may be useful.

-- 
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/619

Received on Monday, 26 December 2016 04:47:42 UTC