[DOM2 Range] bug in example to handle insertions

Found an issue in DOM2 Range that doesn't seem to be addressed anywhere that I could find:

Section 2.12.1 (handling insertions) says that the boundary point offset should only be adjusted if the insertion point's offset is strictly less than it. However, the first example they give doesn't do this. In the example the start boundary point and insertion point both have an offset of 10 and they adjust the offset anyway, so that "inserted text" stays out of the range. Opera and Firefox both do what the text says and so "inserted text" ends up in the range (Webkit doesn't seem to handle this very well, it doesn't update anything so the range ends up selecting "inserted "). I agree with Opera/FF's behavior, so I think the example should be corrected to include the inserted text.

Cheers,
kats

Received on Saturday, 27 December 2008 00:18:24 UTC