W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2005

DOM 3 core: Node.insertBefore exceptions. Erratum?

From: Dieter Köhler <d.k@philo.de>
Date: Fri, 09 Sep 2005 15:13:52 +0200
Message-Id: <5.2.1.1.0.20050909151340.0208cbb0@wheresmymailserver.com>
To: <www-dom@w3.org>

The DOM 3 Core specification says that a call to Node.insertBefore raises a 
HIERARCHY_REQUEST_ERR: "... if this node if of type Document [p.41] and the 
DOM application attempts to insert a second DocumentType or Element 
node."  However, an equivalent exception condition is missing in the 
ReplaceChild and AppendChild methods.  Was this intented?

A related issue is whether the exception condition should not be made even 
strikter, i.e. require that an Element node always goes *after* a 
DocumentType node.

Another special case which is not covered by the specification of 
Node.insertBefore is what should happen if RefChild and NewChild are 
identical.  Shouldn't that be an exception condition as well?  If not, it 
implies that the position of the child node remains unchanged. But what are 
then the implication for DOM 3 Events: Is a DOMNodeRemoved event followed 
by a DOMNodeInserted event triggert or none at all?

Dieter Köhler 
Received on Friday, 9 September 2005 13:17:02 GMT

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