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

Monkeypatching document.createElement() is wrong

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 12 Feb 2013 11:24:59 +0000
Message-ID: <CADnb78jrgW9NUT-caKiAgBBZ9UQsOVyEs1-MMkm3V15yUHFgbA@mail.gmail.com>
To: WebApps WG <public-webapps@w3.org>
If the goal of custom elements is to expose the guts of what happens
is the wrong solution. Currently new Image() and createElement("img")
are equivalent and no additional magic is required. Same for new
Audio() and createElement("audio"). What we want is that

var x = document.createElement(name)

maps to / is identical to

var x = new name's-corresponding-object

and nothing else.

Received on Tuesday, 12 February 2013 11:25:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:58 UTC