Re: [w3c/webcomponents] [idea] childConnectedCallback and childDisconnectedCallback (#550)

> the right approach is for the child to report its insertion to the parent

That's basically the idea in the example of https://github.com/w3c/webcomponents/issues/785#issue-403640120.

> parser may pause for seconds at a time when there is a network delay.

Ah, that explains even more, so it's something stuck somewhere between microtasks and macrotasks.

> It's simply not the right pattern by which to write an element.

It can be fine if the relationship between parent is part of the API. For example: `select > option`. `tr > td`.

In my cases, I have one example where a parent lays out children, but the children need to be a certain type:

```html
            <!-- lays out nodes using Apple-style VFL -->
            <i-autolayout-node
                id="layout"
                position="0 0 0"
                align=" 0.5 0.5 0"
                mount-point=" 0.5 0.5 0"
                visual-format="
                    V:|-[child1(child3)]-[child3]-|
                    V:|-[child2(child4)]-[child4]-|
                    V:[child5(child4)]-|
                    |-[child1(child2)]-[child2]-|
                    |-[child3(child4,child5)]-[child4]-[child5]-|
                "
                style="background: rgba(0,0,0,0.3)"
            >

                <i-dom-plane size="1 1 0" color="deeppink" class="child1">This is a paragraph of text to show that it reflows when the size of the layout changes size so that the awesomeness can be observed in its fullness.</i-dom-plane>
                <i-dom-plane size="1 1 0" color="deeppink" class="child2">This is a paragraph of text to show that it reflows when the size of the layout changes size so that the awesomeness can be observed in its fullness.</i-dom-plane>
                <i-dom-plane size="1 1 0" color="deeppink" class="child3">This is a paragraph of text to show that it reflows when the size of the layout changes size so that the awesomeness can be observed in its fullness.</i-dom-plane>
                <i-dom-plane size="1 1 0" color="deeppink" class="child4">This is a paragraph of text to show that it reflows when the size of the layout changes size so that the awesomeness can be observed in its fullness.</i-dom-plane>
                <i-dom-plane size="1 1 0" color="deeppink" class="child5">This is a paragraph of text to show that it reflows when the size of the layout changes size so that the awesomeness can be observed in its fullness.</i-dom-plane>

            </i-autolayout-node>
```

-- 
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/550#issuecomment-458396985

Received on Tuesday, 29 January 2019 03:47:45 UTC