[w3c/webcomponents] "is" attribute for autonomous custom elements (#603)

Based on my concerns raised in this [SO question](http://stackoverflow.com/q/40171535/931340) where I ask for a way to have custom elements behave as normal input elements, I didn't get any satisfying answer and I still think that's a big use case that should be solved by the custom elements standard. Current solutions to this limitation involve wrapping native inputs with a custom element and manually syncing the state of this input with the state of the custom element; but the problem with wrapping is ... well it's wrapping.
  
Please note that I ask for the 'full package', that is, a way to create an element that can have custom behavior, extend/be treated like an existing native element(e.g. `<input>`) AND be able to define it's own shadow root to have any arbitrary inner structure and rendering. Unfortunately custom built-in elements can not fulfill the last condition since there is a very limited white list of native elements that can have shadow roots attached(basically any interesting element is excluded). Besides that the strong position of some browser vendors about not implementing the later creates a lot of friction in the community and puts that the standard in the same path HTML Imports or Object.observe are.  

The only thing that comes into my mind to solve this issue right now is to allow autonomous custom elements define the `is`(or any other name) attribute(e.g. `<my-input is="input"`) then the browser will treat this element as the native one but probably skipping the rendering part. From my perspective, the one of a normal developer who doesn't know much about the inner workings of the browsers nor have a full picture of all of the tiny details, seems simple and doesn't look like it would conflict with anything on the currently standard, maybe custom elements would have to implement some extra interface required for the browser to treat them as the native ones but in general looks like something do-able. 

-- 
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/603

Received on Wednesday, 9 November 2016 10:07:40 UTC