W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1998

If insertBefore() of DocumentFragment encounters hierarchy error. ..

From: <keshlam@us.ibm.com>
Date: Thu, 10 Sep 1998 18:42:21 -0400
To: www-dom@w3.org
Message-ID: <8525667B.007C1704.00@us.ibm.com>
(ie, if one of the children of the Fragment is not something that can be
inserted into the target node)... What's the expected behavior?

There are three obvious choices:

1) Insert up to the point where the conflict exists, leave it and anything
following in the DocumentFragment. Reasonable, trivial to implement. And
since it's what I'm currently doing, I'm slightly biased toward it.

2) Scan all the kids before insertion starts, and throw the exception if
any of them are unacceptable. Reasonable, a bit more overhead but far from
unacceptable, and arguably a bit more robust.

3) Copy all the kids which can be copied, leaving only the problem children
in the DocumentFragment. A bit less reasonable, I think, but also easy to

Joe Kesselman  / IBM Research
Unless stated otherwise, all opinions are solely those of the author.
Received on Thursday, 10 September 1998 17:36:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:04 UTC