Question about SVG List replaceItem

http://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList states for
replaceItem(newItem,index):

Replaces an existing item in the list with a new item. If newItem is already
in a list, it is removed from its previous list before it is inserted into
this list.

and that index is "The index of the item which is to be replaced."

Let's say my path seg list has {x,y,z} and I call replaceItem(x,1).

Since x is actually in this seg list, it should be remove BEFORE
being inserted.  Removing x from the seg list means that y has become the
0th item in the list and that z is the 1st item in the list.

So should the resultant seg list after replaceItem(x,1) has been called be:

{x,z} - my guess
or
{y,x}

I think the index is probably the index of the item to be replaced before
the new item has been removed from its current list.

Thanks,
Jeff

Received on Friday, 23 May 2008 05:45:42 UTC