Re: node.insertBefore(child, child)

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
refChild.

> 
> > 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).

Philippe

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