[whatwg/dom] Custom element callback/promise for "connected and parsed" (#662)

Developers seem to assume that `connectedCallback` means the element's contents will be present. This isn't helped by browser differences here ([demo](https://wc-connected-test.glitch.me)). Safari & Firefox get it wrong and show some element contents in `connectedCallback` depending on loading speed. Chrome appears to get it right.

However, consider an element like `<video>`. Because `<video>`'s contents influence what should be loaded, the content shouldn't be considered until the parser has stopped adding elements into the `<video>`, else you can end up with pointless double fetching.

Do we need something similar for custom elements? This could be an additional callback, or perhaps even `htmlElement.parsed`, which is a promise that resolves once the element has fully parsed. This would be useful in other situations too, as `document.documentElement.parsed` would be similar to DOM-ready.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/662

Received on Friday, 29 June 2018 10:19:05 UTC