W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2011

Re: [DOM4]: Element.create

From: Jonas Sicking <jonas@sicking.cc>
Date: Fri, 16 Sep 2011 17:14:18 -0700
Message-ID: <CA+c2ei9u+vOM0a8pkBWANSuvdmb4UArHtUzrVWpLUBA=3izJnA@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: Anne van Kesteren <annevk@opera.com>, "www-dom@w3.org" <www-dom@w3.org>
On Friday, September 16, 2011, Ian Hickson <ian@hixie.ch> wrote:
> On Thu, 15 Sep 2011, Anne van Kesteren wrote:
>> On Thu, 15 Sep 2011 20:07:51 +0200, Charles Pritchard <chuck@jumis.com>
wrote:
>> > On webapps, we discussed a helper method, "create", which might fit
well in
>> > DOM4.
>> > http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0707.html
>> >
>> > Element.create('img', {src: '...'}),
>>
>> I'm not sure what the second argument should be in terms of Web IDL. It's
>> basically an unconstrained dictionary, but we do not have that at the
moment.
>
> "object", and define how to process it in prose.
>
>
>> It's also unclear to me whether the second argument should set
>> properties or attributes.
>
> IMHO definitely content attributes. Setting properties seem like it would
> involve all kinds of complicated subtlties like setting order, how to
> handle properties like .innerHTML, etc.
>
> Are there good use cases for setting properties?

Being able to set onfoo event handlers.

While you can do that using strings, it's much better to be able to code
using code than using code-in-strings. The latter also looses scope chains
and creates bad scope chains for form elements.

But I do agree that it would be a pain to deal with any other IDL properies.

/ Jonas
Received on Saturday, 17 September 2011 00:14:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT