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.3.1 : Wednesday, 11 February 2015 14:37:03 UTC