W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Re: Minimum viable custom elements

From: Ryosuke Niwa <rniwa@apple.com>
Date: Wed, 04 Feb 2015 08:51:28 -0800
Cc: Anne van Kesteren <annevk@annevk.nl>, Steve Faulkner <faulkner.steve@gmail.com>, WebApps WG <public-webapps@w3.org>
Message-id: <F72DE3C6-3FB7-4E79-AA87-60C970710F7B@apple.com>
To: Chris Bateman <chrisb808@gmail.com>
See https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0435.html <https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0435.html> first.

> On Feb 4, 2015, at 6:43 AM, Chris Bateman <chrisb808@gmail.com> wrote:
> 
> Assuming a situation where a native element – with custom functionality – is dynamically injected into the page, the basic options I can think of are:
> 
>  - <input is="my-custom-formatter">
>  - <input class="my-custom-formatter"> and a page-level listener
>  - <input class="my-custom-formatter"> and call a function after it's injected

Or <my-custom-formatter><input></my-custom-formatter>.  Note that the author of the custom element can force the markup to have an input element inside by making the element not function when there isn't one on the contrary to what you said in https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0410.html <https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0410.html>  Since custom elements aren't supported by all browsers initially, authors have to implement the fallback anyway.

> I'm not certain having two different mechanisms, namely "type" and "is" attributes, to specify the type of an input an element expects is a desirable approach.
> 
> <input type="text" is="my-custom-formatter">
> 
> I certainly can't speak to your perspective on this, and you may be right. An input's probably not be the best example for making is="" look good. Regardless, I have to trust that devs are smart enough to figure out what's going on here, and set it up properly.

I'd say that line of thought could be dangerous in that once we say we should trust devs to the right thing, we may just say devs should do the right thing for accessibility for themselves.  Since the point of Web components is to improve developer ergonomics, I don't think we should assume developers to be particularly "smart" or "experienced".  We want to make the Web a place where everyone can start writing great apps without knowing some weird quirks of the platform.

- R. Niwa
Received on Wednesday, 4 February 2015 16:51:58 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC