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

Previously: https://github.com/w3c/webcomponents/issues/619, https://github.com/w3c/webcomponents/issues/550.

Video/source does not appear to work in the way you describe:

> If a source element is inserted as a child of a media element that has no src attribute and whose networkState has the value NETWORK_EMPTY, the user agent must invoke the media element's resource selection algorithm.

There are a couple elements which do work this way. You can find them by searching for things that trigger when the element is popped off the stack of open elements. It appears that list consists of:

- object
- video/audio but only with respect to text tracks
- textarea
- style
- script elements, but via a different mechanism (more hard-coded into the parser)

I'm not sure it's worth spreading this pattern further, as opposed to just saying it's a legacy pattern. The most compelling examples you might want to emulate are style/script (i.e., don't apply styles/execute script until all of the text content is present). But do we see a lot of people trying to do the style/script case? My impression is it's mostly been people who are unwilling to put in the work of making their element properly reactive to descendant changes, i.e. they want to use children as configuration for initial setup, and not as part of a dynamic tree.

-- 
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#issuecomment-401392526

Received on Friday, 29 June 2018 15:40:30 UTC