Re: A proposal for Element constructors

2011-10-28 Thread John-David Dalton
Rick has a point. I used Prototype's Element constructor for years and have moved towards the jQuery approach in my own API. Something like Element('div') is so so soo nice compared with more verbose alternatives and you can still add attributes to elements via a second argument. I know some

Re: A proposal for Element constructors

2011-10-27 Thread Kentaro Hara
Thanks for comments! Preface: Basically, I do not intend to propose Element constructors __instead__ of Element.create(button, ...) or new Element(button, ...) or some possible extension of .createElement(button, ...). I think that both are useful. In this thread, I would like to discuss whether

Re: A proposal for Element constructors

2011-10-26 Thread Julien Richard-Foy
This proposal sounds very interesting. On Wed, Oct 26, 2011 at 5:54 AM, Adam Barth w...@adambarth.com wrote: Another solution to that more than one tag per interface problem is to introduce subclasses of those interfaces for each tag. +1 Julien

Re: A proposal for Element constructors

2011-10-26 Thread Cameron McCormack
On 25/10/11 8:54 PM, Adam Barth wrote: Another solution to that more than one tag per interface problem is to introduce subclasses of those interfaces for each tag. Instead of introducing more interfaces (which don't have additional functionality), and instead of introducing Element.create, I

Re: A proposal for Element constructors

2011-10-26 Thread Rick Waldron
On Wed, Oct 26, 2011 at 4:33 PM, Cameron McCormack c...@mcc.id.au wrote: On 25/10/11 8:54 PM, Adam Barth wrote: Another solution to that more than one tag per interface problem is to introduce subclasses of those interfaces for each tag. Instead of introducing more interfaces (which don't

Re: A proposal for Element constructors

2011-10-26 Thread Rick Waldron
As a developer that writes JavaScript every single day, the sheer amount of typed characters required for using the constructors in this proposal is enough for me to avoid it at all costs. On Tue, Oct 25, 2011 at 11:42 PM, Kentaro Hara hara...@chromium.org wrote: Hi folks, * Background *

Re: A proposal for Element constructors

2011-10-26 Thread Kentaro Hara
Thanks, all! Adam: Another solution to that more than one tag per interface problem is to introduce subclasses of those interfaces for each tag. I agree. new HTMLInsElement() is more consistent with other Element constructors than new HTMLModificationElement( {tagName: 'ins'} ). Rick: As a

A proposal for Element constructors

2011-10-25 Thread Kentaro Hara
Hi folks, * Background * I have been working on making DOM objects look and feel more like ordinary JavaScript objects. I implemented Event constructors [1], for example. * Proposal * Element.create() has proposed and been under discussion [2]. Besides Element.create(), I propose

Re: A proposal for Element constructors

2011-10-25 Thread Adam Barth
Another solution to that more than one tag per interface problem is to introduce subclasses of those interfaces for each tag. Adam On Tue, Oct 25, 2011 at 8:42 PM, Kentaro Hara hara...@chromium.org wrote: Hi folks, * Background * I have been working on making DOM objects look and feel more