- From: Hayato Ito <notifications@github.com>
- Date: Tue, 04 Oct 2016 21:27:53 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Message-ID: <w3c/webcomponents/issues/574/251578951@github.com>
> Adding a shadow to my-tab does not allow me to achieve the desired composed DOM (see the issue description). If the slot name exists as a slot in the direct parent, then it would behave as normal nested components.
I have taken a look the composed DOM in the example, and now I understand why it is impossible. You are correct. Sorry for my misunderstanding.
My opinions for this idea:
- I am not fan of this idea. If we allow that, markup (in children of the shadow host) does not have meaning. That is not what we want, I think.
For example, suppose that users write the following markup:
```html
<my-tabs>
<my-tab>
<my-tab-title>
Title 1
</my-tab-title>
<my-tab-content>
Content 1
</my-tab-content>
</my-tab>
<my-tba>
<my-tab-title>
Title 2
</my-tab-title>
<my-tab-content>
Content 2
</my-tab-content>
</my-tab>
</my-tabs>
```
I guess you did not notice the typo in the markup. They wrote `<my-tba>`, instead of `<my-tab>`. However, because this is still correctly rendered, regardless of the mistake, users would not notice their mistakes. That is not what we want to introduce to HTML world, I think. We want correct feedback by returning the wrong rendering result if the markup is wrong.
- This new idea should work with the rest of Shadow DOM APIs. For example, how event path should be? The no-op parent should receive an event which happens at its descendant which is assigned to a slot. But it is difficult to have a nice answer how we can calculate an event path in this case.
--
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/574#issuecomment-251578951
Received on Wednesday, 5 October 2016 04:28:23 UTC