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

@domenic said,

> This was previously discussed at length in the other bug tracker, and it's explained in the spec in the sentence above that:
> 
> > Customized built-in elements require a distinct syntax from autonomous custom elements because user agents and other software key off an element's local name in order to identify the element's semantics and behaviour. That is, the concept of customized built-in elements building on top of existing behaviour depends crucially on the extended elements retaining their original local name.


Can't they key off on the prototype? They can traverse up the prototype chain until finding the first native prototype to get a clue from. End devs do

```js
customElements.define('my-row', class extends HTMLTableRowElement {...})
```

The browsers say "oh hey, this custom element has the `HTMLTableRowElement` prototype, let's apply those native behaviors without needing to look up the tag name".

How difficult is it to make new distinguishable classes for the current ambiguous elements (quotes, blockquotes, etc)? It doesn't seem that hard.

That would be a nice big first step in my opinion.

@oleersoy 

> The two core things we are trying to do here is provide us (The component makers) with the flexibility to make the best components we can for the broadest audience (Folks that need screen readers, etc.) while at the same time providing the simplest most effective workflow for the html developers that are going to put these new components / elements to use, as well as the developers that will be maintaining this work.

The second half of that is achieved simply by having browsers key off on the prototype. Simple and done.

So at the very least why not just fix ambiguous prototype, make prototype detection be the key-off mechanism, then keep working on the remaining problems after that?

This would be better than what we have right now, and (I think) it doesn't get in the way of solving the crawlability problems later.

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

Received on Wednesday, 8 March 2017 17:19:07 UTC