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

Re: Some specification clarification questions

From: Philippe Le Hegaret <plh@w3.org>
Date: Wed, 29 Nov 2000 14:28:28 -0500
Message-ID: <3A2558DC.250458AD@w3.org>
To: shawn@pobox.com
CC: www-dom@w3.org
Shawn Silverman wrote:
> 
> Hi all.  I was busy implementing the DOM level 2, and I came across a few
> issues which I felt weren't specified clearly (I probably missed
> something).  Here are my questions:
> 
> 1) in Node.replaceChild() and Node.removeChild(), since oldChild is
> returned, does it have its parent and siblings set to null, or will the
> user require knowing what this old node pointed to?

They are set to null.

[[[
nextSibling of type Node, readonly 
  The node immediately following this node. If there is no such node, this
  returns null.
parentNode of type Node, readonly 
  The parent of this node. All nodes, except Attr, Document, DocumentFragment,
  Entity, and Notation may have a parent. However, if a node has just been
  created and not yet added to the tree, or if it has been removed from the tree,
  this is null.
]]]

-- Document Object Model Core
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
Thu, 09 Nov 2000 23:18:19 GMT


> 2) in Node.cloneNode(), for a non-deep copy, are the *references* to the
> children supposed to be copied as well?  Eg. if an Element has 3 children
> and we clone it (non-deep), will that new node have three children
> pointing to the original three children?

For a non deep copy, only the element and his attributes are copied. Childrens
are not included.

[[[
deep of type boolean 
  If true, recursively clone the subtree under the specified node; if false,
  clone only the node itself (and its attributes, if it is an Element).
]]]

-- Document Object Model Core
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247
Thu, 09 Nov 2000 23:18:19 GMT


Philippe
Received on Wednesday, 29 November 2000 15:01:54 GMT

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