W3C home > Mailing lists > Public > www-svg@w3.org > May 2008

Question about SVG List replaceItem

From: Jeff Schiller <codedread@gmail.com>
Date: Fri, 23 May 2008 00:45:06 -0500
Message-ID: <da131fde0805222245y2a163e0eh322bbf9bee5a1364@mail.gmail.com>
To: www-svg <www-svg@w3.org>
http://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList states for

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

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.

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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:13 UTC