Monkeypatching document.createElement() is wrong

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 UTC