[webcomponents] Exposing a CanvasImageSource hidden by a Shadow Tree (#388)

One of the things we're using Custom Elements/Shadow DOM for is a video player with custom controls.  An issue came up yesterday where a client wanted to render the video onto a canvas like this simplified version:

```html
<x-video name="vid1" autoplay>
```
```javascript
var vid = document.querySelector('x-video');
canvasContext.drawImage(vid, 0, 0, vid.width, vid.height);
```
Currently, we actually expose the `<video>` element because I actually foresaw problems like this one, so I was able to tell them to use `vid.player` instead.  However, I'd certainly prefer not to let developers have access to elements in the shadow tree for obvious reasons.

I'm wondering if we could spec something like `shadowRoot.canvasImageSource = htmlVideoElement;` to allow drawing custom elements with shadow trees to canvases.

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

Received on Thursday, 18 February 2016 10:54:13 UTC