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

@oleersoy 

> Since that's a priority the element that the is attribute is on cannot collaborate with any other custom element on the page, since that breaks the solution.

I believe custom elements generally aren't supposed to depend on other custom elements being in the page, so they work independently.  I can't find where I saw that; I think it was in a talk at the Polymer Summit.  But if you think about it, the only thing an element should depend on is its own content probably.

Also
> `
> class FancyButton extends HTMLButtonElement
> `

is already in the spec but it still needs to identify what element you wish to apply it to because HTMLButtonElement is an interface and elements share interfaces so there is a small problem about what element is being targeted, if its native.  That is why we have the {extends: 'button'} parameter in customElements.define, so the actual element which is being overtaken is identified.

> adds more units tests,

Don't think this is true.  Why would a customized built-in element have more tests?  If anything it would have fewer, because it inherits behaviour.  Without customized built-ins, as pointed out by others, we can only extend HTMLElement, which doesn't buy you much - you have to re-build everything in javascript.

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

Received on Thursday, 8 December 2016 14:07:36 UTC