Re: Multiple potential exceptions: nodereplacechildnewchilddiffdocument

The original java code checks for a WRONG_DOCUMENT_ERR, so I am sure 
that this was probably a cut-and-paste error -- I suspect that the test that was 
originally immediately before this one probably checks for a NOT_FOUND_ERR.
Please do change it.

--Mary
  ----- Original Message ----- 
  From: Curt Arnold 
  To: www-dom-ts@w3.org 
  Sent: Wednesday, August 22, 2001 1:28 PM
  Subject: Multiple potential exceptions: nodereplacechildnewchilddiffdocument


  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:47:29 UTC