W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

Re: Why not Node.insertAfter()?

From: Eric Richardson <maxwell@telesoft.com>
Date: Wed, 08 Mar 2000 11:32:24 -0700
Message-ID: <38C69CB8.723ABA02@telesoft.com>
To: keshlam@us.ibm.com
CC: DOM <www-dom@w3.org>
keshlam@us.ibm.com wrote:

> node.insertAfter(newKid,refChild), if it existed, would be precisely
> equivalent to node.insertBefore(newKid,refChild.getNextSibling()).

So I guess I should interpret getNextSibling() as the next node at the
same level as the refChild? I thought sibling was a node with the same
tagname sort of like my lastname <richardson> which would be the same
for my siblings.

> Note that inserting before null means inserting at the end of the list, so
> the Right Thing should happen even in that case.  Also note that a
> shorthand in that case is node.appendChild(newKid).

So this means insert at the end based on the node's context.

These are obviously errant thoughts of a DOM mortal, based
on the english language, not the spec. I think I got it unless I said
something really wrong.

Thanks for the help,

> So insertAfter might be convenient, but isn't strictly necessary. Which is
> why we left it out of Level 1.
> ______________________________________
> Joe Kesselman  / IBM Research
Received on Wednesday, 8 March 2000 13:36:21 UTC

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