Re: HTMLElement.register--giving components tag names

On Tue, Aug 30, 2011 at 22:33, Dominic Cooney <dominicc@chromium.org> wrote:

> You will notice that this says nothing about how prototypes are wired
> up. It should. Maybe the argument to extend should have an optional
> second field, proto, that specifies the new methods/getters/setters
> that ContactPicker's prototype should introduce.
>
> This is not a general subtyping mechanism! It is only designed for
> setting up subtypes of HTMLElement for use with register. When
> ECMAScript and the DOM bindings are sufficiently aligned,
> HTMLElement.register can be opened up to accept constructors defined
> using ordinary ECMAScript mechanisms for subtyping DOM interfaces.
> Scripts can continue to use extend (it is pretty succinct) or
> constructors set up their own way.

Providing a prototype is important.

For example I can imagine UI toolkits providing their own "base class"
that all the custom elements extend.

Also, it seems essential to allow extending other things than just HTMLElement.

-- 
erik

Received on Wednesday, 31 August 2011 20:39:21 UTC