Re: node.insertBefore(child, child)

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 
(Oracle).

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