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
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#monkeypatch-create-element
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.


-- 
http://annevankesteren.nl/
Received on Tuesday, 12 February 2013 11:25:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:57 GMT