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

RE: Defining a constructor for Element and friends

From: Domenic Denicola <d@domenic.me>
Date: Tue, 13 Jan 2015 18:45:39 +0000
To: Ryosuke Niwa <rniwa@apple.com>, Boris Zbarsky <bzbarsky@mit.edu>
CC: Anne van Kesteren <annevk@annevk.nl>, WebApps WG <public-webapps@w3.org>, "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <CY1PR0501MB13690DD9ADF734ADF2A0908BDF400@CY1PR0501MB1369.namprd05.prod.outlook.com>
From: Ryosuke Niwa [mailto:rniwa@apple.com] 

> Shouldn't we throw in this case because the concert type of "somename" is HTMLUnknownElement?

Yes, that's exactly the current design. Hidden a bit:

https://github.com/domenic/element-constructors/blob/master/element-constructors.js#L4


This still leaves the potential hazard of someone doing `new HTMLUnknownElement("somename")` and their code breaking later once "someone" becomes a real tag... hopefully the "Unknown" is a bit more of a deterrent though?

(It'd be nice if HTMLElement weren't a global and you had to do `import HTMLElement from "html/parser-internals"` or something. Ah well.)

Received on Tuesday, 13 January 2015 18:46:17 UTC

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