W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2010

[whatwg] DOM Range Deletions

From: Andrew Oakley <andrew@ado.is-a-geek.net>
Date: Tue, 15 Jun 2010 11:52:12 +0100
Message-ID: <4C175B5C.2050106@ado.is-a-geek.net>
I've been trying to implement DOM Range but can't work out how ranges
are supposed to work under mutation.

In the following examples I use *this* to indicate a range being deleted
and slashes to indicate another range.

Section 2.6 - Deleting Content with a Range gives the example of


Section 2.12.2 - Deletions says:

"If a boundary-point of the original Range is within the content being
deleted, then after the deletion it will be at the same position as the
resulting boundary-point of the (now collapsed) Range used to delete the

We then have the example of:

<P>ABCD *efgh The <EM>R*ange</EM> ijkl</P>
              /            \

Goes to

<P>ABCD <EM>ange</EM> ijkl</P>
           /    \

I assume that the range indicated by the underline in the spec and like
*this* here collapses to just before the <EM> tag as this document has
the same structure as the other example I pulled out of the spec.  This
would mean that the start point of the other range should also be just
before the <EM>, but that isn't what has happened in this example.

Any idea what I've got wrong?  Some browsers (e.g. Safari) seem to
behave as in the example, others (e.g. Firefox) put the end point before
the <EM> (as I would have expected).


Andrew Oakley
Received on Tuesday, 15 June 2010 03:52:12 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC