W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: [webcomponents] Custom Elements Spec

From: Alex Russell <slightlyoff@chromium.org>
Date: Wed, 2 May 2012 09:54:22 +0100
Message-ID: <CANr5HFVTrtxnqHm3WmycVPSUS5kusrk4+0c0LrJgOyBXUCwgOQ@mail.gmail.com>
To: Dimitri Glazkov <dglazkov@chromium.org>
Cc: public-webapps <public-webapps@w3.org>
On Wed, May 2, 2012 at 12:42 AM, Dimitri Glazkov <dglazkov@chromium.org> wrote:
> Based on the hallway conversations at the F2F, here are some notes for
> the upcoming Custom Elements spec.
>
> Custom tags vs. "is" attribute
> - "is" attribute is awkward, overly verbose
> - custom tags introduce local semantics
> - generally viewed as a rabbit-hole discussion in WebApps scope
> - Tantek (tantek) suggested we work this out in HTML WG
> - perhaps start with something as simple as reserving "x-" prefix on
> HTML tags for local semantics.
>
> Instantiation and running script
> - both Microsoft and Mozilla folks wish to avoid running script when
> instantiating elements, which is a valid concern (mutation events
> redux)

I'm having trouble with this. Components are defined as script-driven
lifecycles. Script *is* the runtime.

> - instantiation of the element must set up the prototype chain
> properly, since ES5 does not allow prototype swizzling

ES 6 will in an appendix. We can (ab)use __proto__ for now.

> - Tony (tross) is worried that even if handled asynchronously, the
> performance characteristics of running script when parsing HTML should
> be carefully considered
> - Jonas (sicking) reiterated that it is _critical_ that the custom
> element's behavior is strongly bound to the lifetime of its element

Can't agree more. This is another strong reason to simply have custom
elements simple be JS objects created the standard way. That way the
identity is unambiguous and unchangeable. That some implementations
may have C++ gunk hanging out in the background is neither here nor
there. It's an implementation detail.

> Random ideas from various people:
> - Minimal custom elements: spec building the prototype chain in
> parser, spec template tag. Given these, the rest of the spec can be
> implemented in JS.
> - Start writing the spec with element instantiation, evaluate
> performance issues and tweak until awesome.
> - Ship Shadow DOM, reserve "x-" prefix, and let the Web devs start
> using new stuff. Study what comes back and see what else needs to be
> done.

Outstanding!
Received on Wednesday, 2 May 2012 15:08:03 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:52 GMT