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

Re: Defining a constructor for Element and friends

From: Ryosuke Niwa <rniwa@apple.com>
Date: Tue, 13 Jan 2015 23:46:14 -0800
Cc: Bjoern Hoehrmann <derhoermi@gmx.net>, WebApps WG <public-webapps@w3.org>, "www-dom@w3.org" <www-dom@w3.org>
Message-id: <2A27C0A6-D484-4D9E-85A2-F3F2893149D0@apple.com>
To: Domenic Denicola <d@domenic.me>

> On Jan 13, 2015, at 8:26 PM, Domenic Denicola <d@domenic.me> wrote:
> From: Bjoern Hoehrmann [mailto:derhoermi@gmx.net] 
>> I know that this a major concern to you, but my impression is that few if any other people regard that as anything more than "nice to have", especially if you equate "explaining" with having a public API for it.
> How do you propose having a private constructor API?

I don't think we need to make the constructor of HTMLUnknownElement private.  It certainly isn't today.  We just need to throw whenever it's called.

> How do you propose instances of the objects even existing at all, if there is no constructor that creates them?
> This is one of those "only makes sense to a C++ programmer" things.

We can model it as a constructor that takes a private symbol only the DOM implementation has access to, and throws whenever this symbol is not passed in as an argument.

- R. Niwa
Received on Wednesday, 14 January 2015 07:47:04 UTC

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