[w3c/webcomponents] Unspecified behaviour with regards to attributeChangedCallback and DOM access (#767)

According to the specification, the limitation of not allowing access to children or attributes of a Custom Element [only applies to the constructor](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-conformance). 

At the moment, `attributeChangedCallback` may be called immediately after the `constructor` during the lifecycle of a Custom Element, as demonstrated in [this example](https://codepen.io/ruphin/pen/dgVgJq?editors=1010). In this case, the children and attributes of the element may also not be available. 

The current implementations in Chrome, Safari, and Firefox all show the same behaviours with regards to this issue, so the behaviour seems to be specified, but I think it would be good to have it explicitly documented. We stumbled upon this issue when developing a DOM rendering framework for use with Web Components, and it would be nice to have explicit clarification from the spec.

Perhaps we can attach a note to step 4 in [the upgrade path](https://html.spec.whatwg.org/multipage/custom-elements.html#upgrades) that documents this behaviour. I can make a PR for this if requested.

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

Received on Sunday, 14 October 2018 23:34:03 UTC