W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2011

[whatwg] Constructors for HTML Elements

From: James Graham <jgraham@opera.com>
Date: Mon, 07 Nov 2011 15:00:14 +0100
Message-ID: <4EB7E46E.6020202@opera.com>
There seems to be some interest in making all concrete interfaces in the 
DOM constructible (there also seems to be some interest in making 
abstract interfaces constructible, but that seems insane to me and I 
will speak no further of it).

This presents some special difficulties for HTML Elements as there is 
not generally one interface per tag (e.g. HTMLHeadingElement is used for 
h1-h6) and making all zero-argument constructors work seems like a more 
natural API than sometimes having to say 'new HTMLDivElement()' and 
sometimes having to say 'new HTMLHeadingElement("h1")'. So the question 
is whether we can change this without breaking compat. The only problem 
I foresee is that adding new interfaces would change stringification. 
But I think it is possible to override that where needed.
Received on Monday, 7 November 2011 06:00:14 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:09 UTC