Re: Node append

On 9/20/11 10:02 AM, Robin Berjon wrote:
> On Sep 16, 2011, at 17:13 , Anne van Kesteren wrote:
>> Maybe instead of a new append() method we could simply make the methods that already accept DocumentFragMent accept arrays too? The arrays would be valid as long as they only contain nodes DocumentFragment can contain or DOMString.
>>
>> Let me know what you think.
>
> I like that plan. DocumentFragment is little more than an array already anyway.

There are some subtle differences (e.g. a DocumentFragment has a 
well-defined ownerDocument and generally behaves like a Node and such).

I can probably live with overloading things like appendChild to take 
arrays as long as we keep in mind that this will slow down every single 
appendChild call in the common case of a node being passed.  Presumably 
we're ok with this, since we're discussing it.

-Boris

Received on Tuesday, 20 September 2011 16:34:10 UTC