W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2007

Which exception to throw when multiple apply?

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 30 Apr 2007 13:54:27 +1000
To: www-dom@w3.org
Message-ID: <20070430035427.GB18854@arc.mcc.id.au>

Hi.

It doesn’t seem to be specified in DOM 3 Core what exception code should
be used when the DOMException is thrown for this document:

  <html>
  <head><title>insertBefore test</title></head>
  <body>
  <div id='d1'><div id='d2'></div></div>
  <script>
    d1 = document.getElementById('d1');
    d2 = d1.firstChild;
    d2.insertBefore(d1, document.documentElement);
  </script>
  </body>
  </html>

Both HIERARCHY_REQUEST_ERR and NOT_FOUND_ERR are applicable.

Is it worth specifying?

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au
Received on Monday, 30 April 2007 03:54:33 GMT

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