[w3c/webcomponents] Idea: ComposedTreeProxy (#516)

After the previous issues I've posted and after reading the [contentious bits](https://github.com/w3c/webcomponents/wiki/Shadow-DOM:-Contentious-Bits#b-the-default-value-of-closed-shadow-tree-flag), it got me thinking.

What if there was a way to get access to a "composed tree proxy" that would be a mirror of the composed tree at any time, but would allow only certain things to be accessed. The things that are accessible would be those things the user can interact with.

For example, if I can click a button on the screen, and that button is nested deeply in some deep shadow root, then I should also have equal script access to trigger that click event.

The composed tree would (obviously) allow one to learn the structure of the composed tree, and each node in this tree would be a proxy to the actual elements. Some things would be possible, like triggering a click event, while other things like accessing methods and properties would not be possible.

It could be retrieved starting at any element, and going X number of shadow trees deep:

```js
element.getComposedTreeProxy(3) // 3 shadow-tree levels deep.
```

The proxy nodes could be very limited: It might not be possible to even set attributes on them if their shadow tree is closed, and other things like that.

---
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/516

Received on Tuesday, 7 June 2016 02:23:25 UTC