W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2013

Re: new DOM4 insertions methods and return values

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 16 Jan 2013 09:58:00 -0500
Message-ID: <50F6BFF8.6060900@mit.edu>
To: www-dom@w3.org
On 1/16/13 5:32 AM, Jake Verbaten wrote:
> The only reason to pass the document fragment back is to match what
> elem.appendChild(documentFragment) does currently and to have the result
> be either null or a single type. In reality it might make more sense to
> return the first node in nodes or the nodes as an array.

Note that having a non-void return value makes the method slower. 
Sometimes significantly slower (especially if the return values are 
polymorphic like you just describe)...

So there had better be very good use cases for this sort of thing. ;)

-Boris
Received on Wednesday, 16 January 2013 14:58:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 16 January 2013 14:58:32 GMT