W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2004

Re: node.insertBefore(child, child)

From: Philippe Le Hegaret <plh@w3.org>
Date: Mon, 05 Jan 2004 15:16:27 -0500
To: Ian Hickson <ian@hixie.ch>
Cc: WWW DOM <www-dom@w3.org>
Message-Id: <1073333786.28167.83.camel@jfouffa.w3.org>

On Mon, 2004-01-05 at 14:45, Ian Hickson wrote:
> On Mon, 5 Jan 2004, Philippe Le Hegaret wrote:
> >>
> >>    node.insertBefore(child, child)
> >
> > It is indeed the behavior of common UAs, but unfortunately, it is not
> > the case on Xerces. Given that at least one significant implementation
> > is following the specification, we cannot render it non conformant by
> > modifying the specification to accomodate and describe the behaviors of
> > the UA implementations.
> Why not?
> Is there any code anywhere that depends on Xerces raising an exception?

I don't know.

> Does Xerces really do what the spec says? (i.e. both remove the node and
> raise an exception.)

It does remove the node and insert it again. While the spec does say
that you should raise an exception if the refChild is not in the tree,
it doesn't say if you must do the hierarchy check _after_ removing the

> > node.insertBefore(child, child) and node.replaceChild(child, child) are
> > now described as "implementation dependent" in the specification. It
> > does not clarify anything except that DOM applications should now be
> > aware of no interoperability for those cases.
> That's even less useful than raising an exception! :-)

It does acknowledge the fact that UAs don't follow the specification,
which is better than nothing imho. 

> > Let us know if this decision satisfies or not your request,
> Not really. :-)
> I'd rather the behaviour be well specified and useless than not specified
> at all (and would much rather it was well specified and useful, especially
> given the number of interoperable implementations, even if there is one
> implementation that currently removes the node and raises an exception).

... as long as the behavior matches your view of interoperable
implementations, but we just demonstrated that at least one
implementation does not interoperate with the others at the
functionality level.True enough, this implementation is not a UA, but it
is still a DOM implementation that is trying to follow the
specification. It would be much better if DOM applications were not
trying to do node.insertBefore(child, child).

Received on Monday, 5 January 2004 15:16:28 UTC

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