W3C home > Mailing lists > Public > public-webapi@w3.org > May 2008

Re: Proposed errata for DOM2 Range regarding insertNode()

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 14 May 2008 22:11:41 -0500
Message-ID: <482BA9ED.7010400@mit.edu>
To: Ian Hickson <ian@hixie.ch>, "Web APIs WG (public)" <public-webapi@w3.org>

Ian Hickson wrote:
> DOM2 Range doesn't define anything to this level of detail yet, 
> unfortunately.

Indeed.  The wonders of Conway's Law...

Nevertheless, this question is somewhat important in terms of deciding where the 
range should be positioned.

> For example regular old insertions and deletions near 
> ranges cause changes to the range values but the spec doesn't say if this 
> is before or after the events.

I think it's pretty clear that it should be when the actual mutation occurs (so 
before the events for insert cases and after for removal cases), but that does 
mean that one can't implement Range on top of DOM MutationEvents.  Then again, 
there's no much one can implement on top of them, so that's OK, I think.

> It seems that for sanity we should say it happens before, if we specify 
> this. Should we do this as a separate errata?

I just wanted to point out that we have to be very careful in how we phrase this 
erratum (which I agree is a possibly useful one): we basically want to perform 
the insertion, then before firing the mutation event adjust the insertion 
endpoint after all the nodes we just inserted.  Or something.  In a UA that 
would fire multiple events here when inserting a DocumentFragment, we might lose 
no matter what we try to do.

-Boris
Received on Thursday, 15 May 2008 03:12:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 15 May 2008 03:12:33 GMT