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

Re: Which exception to throw when multiple apply?

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Mon, 30 Apr 2007 12:50:35 +0200
To: Cameron McCormack <cam@mcc.id.au>
Cc: www-dom@w3.org
Message-ID: <s0ib33tcpdefbfv9u5s7am6a8pm4og21cf@hive.bjoern.hoehrmann.de>

* Cameron McCormack wrote:
>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?

I do not think it is likely that applications incorrectly trigger either
of the exceptions and at the same time depend on the precise error code.
I do not think we should make some DOM implemenentations non-conforming
without a very good reason to do it. So, no.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Monday, 30 April 2007 10:50:44 GMT

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