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, 14 Jan 2015 10:35:15 -0800
Cc: Anne van Kesteren <annevk@annevk.nl>, Erik Arvidsson <arv@google.com>, Boris Zbarsky <bzbarsky@mit.edu>, public-webapps <public-webapps@w3.org>
Message-id: <6621386F-2B0E-4BCD-B64E-6C8F06758161@apple.com>
To: Domenic Denicola <d@domenic.me>

On Jan 14, 2015, at 9:50 AM, Domenic Denicola <d@domenic.me> wrote:

> From: Anne van Kesteren [mailto:annevk@annevk.nl] 
>> Could you explain how this works in more detail?
> I haven't checked, but my impression was we could just use the same processing model the current spec uses for createdCallback, and use the constructor instead.

See Boris' responses in another thread [1] and [2].  Jonas outlined how this could work in the same thread [3]

The basic problem is that the DOM tree had already been constructed at that point, and you'll be able to access other uninitialized nodes via DOM APIs such as firstChild inside a custom element's constructor.

Now, ES classes have evolved quite a bit since the last we discussed this.  It's possible letting scripts access uninitialized objects is okay; we'll simply throw ReferenceError as it would be done when "this" is accessed before the "root" base class' constructor is called inside a subclass' constructor [4].

[1] http://lists.w3.org/Archives/Public/public-webapps/2013OctDec/0816.html
[2] http://lists.w3.org/Archives/Public/public-webapps/2013OctDec/0818.html
[3] http://lists.w3.org/Archives/Public/public-webapps/2014JanMar/0098.html
[4] https://github.com/tc39/ecma262/blob/master/workingdocs/ES6-super-construct%3Dproposal.md

- R. Niwa
Received on Wednesday, 14 January 2015 18:35:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:43 UTC