W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2000

Re: Comments on Document Object Model Range

From: Joseph Kesselman/Watson/IBM <keshlam@us.ibm.com>
Date: Thu, 2 Nov 2000 13:12:16 -0500
To: www-dom@w3.org
Message-ID: <OFC9D300A3.6E6E313A-ON8525698B.0062E94F@pok.ibm.com>

Elena Litani writes, re Range.insertNode:
>However, what happens if the start offset of start boundary point is 0?
>There is nothing to split there! If we do indeed split the Text node, we
>end up with:
>EMPTY text node->inserted Node->the Original TEXT node

GOOD question. Since we didn't say otherwise, I too would assume this means
the Text node is split and an empty Text is produced, just as would be the
case for Text.splitText(0). Note that the same thing may happen when the
offset is immediately following the last character in the Text.

But I also agree that this isn't obvious. At the very least  we should cite
splitText() rather than just saying "split", since the description of
splitText() makes the handling of the boundary conditions more explicit.

(I think we do need to produce the empty Text node, since there may be
Range boundary points anchored at the start or end of the Text and the
insertion should not cause those to move.)

Joe Kesselman  / IBM Research
Received on Thursday, 2 November 2000 13:13:45 UTC

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