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

Re: Custom element design with ES6 classes and Element constructors

From: Dimitri Glazkov <dglazkov@google.com>
Date: Wed, 14 Jan 2015 11:04:18 -0800
Message-ID: <CADh5Ky0Xdix2+5kUJko+KBdjs5P3yE0DF6_iF-pc0uwUh5n1kA@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: public-webapps <public-webapps@w3.org>
On Wed, Jan 14, 2015 at 9:39 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 1/14/15 11:52 AM, Dimitri Glazkov wrote:
>
>> Would like to point out that we're not talking about a general case
>> here. The actual proto munging in custom elements spec is minimized to a
>> pretty small set.
>>
>
> Pretty small set of which?  Possible mutations, elements, something else.


Had trouble with words here :) Something about minimizing the
impact/effect, and the next paragraph was meant to explain that.


>
>
>  Also, the current design doesn't change the prototype chain arbitrarily:
>>
>
> This is the most important point.  It's possible engines could optimize
> such proto chain insertions better than they do now.  Some feedback from
> engine implementors on how feasible that is would be good to have.
>
>  the effect is limited to inserting a sub-chain into the existing chain.
>>
>
> Is it, though?
>

Yes. I can certainly abuse the machinery to step outside of this rule, but
then I won't be creating useful/well-behaving custom elements.


> I don't see that this is always true, though I would be fine with the
> cases in which it's not true falling off performance cliffs: those would
> only happen when proto chains get munged after element registration.
>
> If we ignore those cases, it's possible JS engines could optimize this
> better than they do now.  JS engine implementor feedback would be pretty
> useful on this matter.



BTW, I agree that we should not hold on to the legacy of wrapper+object
design. That point was probably more about the second point -- the internal
slots of the base types are set at the time of instantiating.

:DG<
Received on Wednesday, 14 January 2015 19:04:45 UTC

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