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

It really feels like this should be the way to extend built-ins:

```js
class CustomTableRow extends HTMLTableRowElement {}
class CustomListItem extends HTMLLiElement {}
class CustomInput extends HTMLInputElement {}
// ...
```

This follows the standard way to extend things and is how you extend custom elements. It'd make sense if this was consistent across the board, without any indirection (`is` etc).

Unfortunately:

```js
// true
document.createElement('q').constructor === document.createElement('blockquote').constructor
```

I remember reading somewhere that changing this at the browser level is hard. But being that we're discussing ideals, extending builtins via the standard mechanism would be ideal, no?

-- 
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-280992014

Received on Monday, 20 February 2017 05:34:33 UTC