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

Re: node.insertBefore(child, child)

From: Curt Arnold <carnold@houston.rr.com>
Date: Tue, 06 Jan 2004 00:45:41 -0600
Message-ID: <3FFA5995.5090203@houston.rr.com>
Cc: Ian Hickson <ian@hixie.ch>, www-dom@w3.org

I surveyed multiple implementations on this issue in preparation for 
last week's WG conference call. 

I believe Crimson came closest to your definition of "following the 
spec", that is removing the reference node and then throws a 
NOT_FOUND_ERR.  This behavior is undesirable since it is not atomic (it 
both mutates the tree and throws an exception) and makes a call to 
insertBefore(child,child) act like a call to removeChild(child).

Multiple vendors decided that the "following the spec" behavior was not 
good thing and took their own approach, either performing a no-op 
(observed behavior of browser), removing and reinserting the node to 
trigger mutation events (Xerces-J) or throwing a HIERARCHY_REQUEST_ERR 

Since all of these behaviors are reasonable and widely deployed and the 
"following the spec behavior" is undesirable, the best that we can do at 
this time is warn people not to make that type of call.
Received on Tuesday, 6 January 2004 01:46:47 UTC

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