W3C home > Mailing lists > Public > www-dom-ts@w3.org > August 2001

Multiple potential exceptions: nodereplacechildnewchilddiffdocument

From: Curt Arnold <carnold@houston.rr.com>
Date: Wed, 22 Aug 2001 12:28:55 -0500
Message-ID: <008b01c12b2f$eba438b0$a800a8c0@CurtMicron>
To: <www-dom-ts@w3.org>
nodereplacechildnewchilddiffdocument.xml is a strange case.  

It calls Node.replaceChild with a old node that is not a child of the target node and attempts to replace it with a node that isn't part of this document.  So it could conceivable throw either NOT_FOUND_ERR or WRONG_DOCUMENT_ERR depending on which condition it tested first.  I don't believe there is anything in the DOM spec that would prescribe which exception code should take precedence and DOMTSML doesn't have a construct to support an ambiguous exception code.

The test is internally inconsistant since the description says
The "replaceChild(newChild,oldChild)" method raises a 
WRONG_DOCUMENT_ERR DOMException if the "newChild" was
created from a different document than the one that 
created this node.

But the test checks for NOT_FOUND_ERR.  I'm going to make the body consistent with the description.
Received on Wednesday, 22 August 2001 13:28:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:03 UTC