Re: [w3c/webcomponents] The is="" attribute is confusing? Maybe we should encourage only ES6 class-based extension. (#509)

Those last three examples are assuming browsers do that aforementioned checking of `instanceof` to ensure that things behave as expected. In browsers where that isn't the case, the custom elements can render to DOM separately. For example, one could write

```html
<my-table>
 <my-tr></my-tr>
</my-table>
```

and the actual result when you inspect element could be

```html
<my-table>
 <my-tr></my-tr>
</my-table>

<!-- rendering result -->
<table>
 <tr></tr>
</table>
```

where any changes to the custom elements are reflected into the rendering result, and any DOM events on the rendered elements are forwarded to the custom element logic. There's ways to accomplish these things without relying on `is=""`.

I agree: in concept, `is=""` is nice for PE and for those edge cases like `table > my-tr`, but when looking at it from the perspective of component programming, it is not so clean (yet) as far as inheritance goes. It would be awesome for that to be cleaned up. And once it is cleaned up, as I [mentioned](https://github.com/w3c/webcomponents/issues/509#issuecomment-266065705), then `is=""` for PE or for fallback cases like `form > my-input` doesn't even need to have anything to do with inheritance at all.

-- 
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/509#issuecomment-266323675

Received on Monday, 12 December 2016 01:19:22 UTC