[webcomponents] How the current model and the v1 model should interact? (#130)

I'm aware that this might not be a design goal of the v1 spec, however, let me file an issue here because this would be a serious issue in Blink.

I guess other browser vendors might not be interested in solving this kind of problems, however, I appreciate your ideas.

The problem is one tree of trees can be composed of both models, the current model and v1 model, in Blink. Blink should support both models for a while (maybe forever?)

e.g.
```javascript
var sr1 = host.createShadowRoot();
sr1.appendChild(shadowRootChild);
var sr2 = shadowRootChild.attachShadow();
```

In such case, I'm afraid that we can't support two distribution models in the same tree of trees well. There is no much attention on this case so far.

I'm feeling that one tree of trees should be used exclusively by either model.

e.g.
- We don't allow attachShadow() for an element in a shadow tree which is created by createShadowRoot().
- We don't allow createShadowRoot() for an element in a shadow tree which is created by attachShadow().

I meant that we might want to have a restriction such as:

- One tree of trees can be composed of one document tree and zero-or-more shadow trees which were created by attachShadow();
- One tree of trees can be composed of one document tree and zero-or-more shadow trees which were created by createShadowRoot();
- All DOM operations which will create *invalid* tree of trees will throw an exception.

*invald* here means one tree of trees includes both, the current shadow tree and v1 shadow tree.


---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/130

Received on Friday, 3 July 2015 04:24:56 UTC