W3C home > Mailing lists > Public > www-svg@w3.org > November 2009

Re: More Ideas around DOM Constructors

From: Helder Magalh„es <helder.magalhaes@gmail.com>
Date: Sat, 21 Nov 2009 11:39:36 +0000
Message-ID: <2a1ddf8a0911210339k6212d96dy84a71389c6319833@mail.gmail.com>
To: "G. Wade Johnson" <gwadej@anomaly.org>
Cc: Jeff Schiller <codedread@gmail.com>, www-svg <www-svg@w3.org>
Hi everyone,

> [snip]
>> 1) Extend createElement(), createElementNS() with a new argument.
>> This new argument should be a name-value map of attributes. †In JS
>> this would look like:
>> createElement("circle", {cx: 40, cy:40, r:20, fill:"red"})
>> As before, this returns the element, which you could then
>> appendChild/insertBefore, etc.
> I really like this idea. To me, this feels more like a single event to
> create an element. When I do
> † createElement( "circle" )
> I feel like I've got a "not quite an object". It's not really created
> until I make a bunch of set calls.

Well mentioned! :-)

This probably would also lead to a good performance boost for DOM2
Mutation Events use-cases, as the object and most or all of its
attributes could then throw a single (?) event. Of course that
arguably a small user base uses it, due to current lack of
cross-implementation support, but still a potential improvement... :-)


[1] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents
Received on Saturday, 21 November 2009 11:40:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:42 UTC