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

RE: Hello and NodeIterator Revisited

From: Andrew n marshall <amarshal@usc.edu>
Date: Tue, 5 May 1998 14:09:57 -0700
To: "Eric Vasilik" <ericvas@microsoft.com>, "www-dom" <www-dom@w3.org>
Message-ID: <000001bd786a$28588bc0$8ae37d80@philica>
> -----Original Message-----
> From: Eric Vasilik
> Subject: RE: Hello and NodeIterator Revisited

It's great to see some commercial implementers on this list.

> Consider the '*' character as the 'point' in the document.  Even though
> there is an iterator underneath the bold tag, the DOM would report that
> there are zero children for the bold.  Now, if one were to create and insert
> a node (say, and italic node) as a new child of the bold node, you have two
> options for updating the iterator:
>
> 	X<B>*<I></I></B>Y, or
> 	X<B><I></I>*</B>Y
>
> The iterator could go to the left of the newly inserted node, or to the
> right of it.

My intuition says the <I></I> should follow the marker, although this
obviously needs to be defined within the DOM.

> Also, given my original example, what would happen to the iterator if the
> bold node were removed from the tree.  Again, you have two options:
>
> 	X*Y, or
> 	XY
>
> Stated in words: should the iterator remain in the document in which it was
> inserted, or should it be associated with the subtree in which it currently
> lives, and move with that subtree?

This seems to depend upon the implicit filter used when creating the
iterator/marker.  If the iterator was created by a getchildNodes call to the
<B> Element, then the marker must remain with the removed node.

If the marker was created for use with a TreeIterator of a ancestor or created
via a call to ancestor's getElementsByTagName(...), then the marker needs to
be placed bewteen X and Y.  However this seems prone to errors since the
iterator just changed position without a method call.  I think some form of
notification needs to in place for this situation.


Andrew n marshall
  student - artist - programmer
     http://www.media-electronica.com/anm-bin/anm
      "Everyone a mentor, Everyone a pupil"
Received on Tuesday, 5 May 1998 17:01:54 GMT

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