W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: Document cloneNode

From: Don Park <donpark@quake.net>
Date: Thu, 8 Oct 1998 16:37:54 -0700
Message-ID: <00bc01bdf314$af984790$2ee044c6@arcot-main>
To: <www-dom@w3.org>

>The method cloneNode utilizes three protected methods: shallowClone, to do
>the immediate cloning stuff; an overload of cloneNode that accepts an owner
>parameter; and a cloneChildren method that clones the children as well as
>sets their owners.

cloneNode(Document owner, boolean deep) scheme should work as well.  I just
chose the double tree walk scheme because a) double tree walk is costs is
insignificant when there is a large number of object instantiation going on,
b) cloneNode is likely to be overriden by user's own subclasses so I did not
want my users to have to deal with extra details of owner document switching
while cloning, and c) I prefer not to introduce unnecessary methods when
dealing with design 'glitch' like this.


Don Park
Received on Thursday, 8 October 1998 19:38:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:04 UTC