Make list object methods make a copy of a list item being inserted if it's already in a list. (ACTION-3634)
authorCameron McCormack <cam@mcc.id.au>
Fri, 22 Aug 2014 23:44:55 +1000
changeset 696 ff12055fb012
parent 695 8dac471c2f5a
child 697 22d3225a3ffb
Make list object methods make a copy of a list item being inserted if it's already in a list. (ACTION-3634)
master/changes.html
master/coords.html
master/paths.html
master/types.html
--- a/master/changes.html	Fri Aug 22 14:26:52 2014 +0100
+++ b/master/changes.html	Fri Aug 22 23:44:55 2014 +1000
@@ -59,6 +59,10 @@
   <li>Change all coordinate types to <a>&lt;length&gt;</a> in preparation for referencing css3-values..</li>
   
   <li>Add the <a>'script'</a> element to the content model of all elements.</li>
+
+  <li class="added-since-last-wd">Changed the initialize, appendItem, replaceItem and insertItemBefore methods
+  on list objects to make a copy of any list item being inserted that is already
+  in another list.</li>
 </ul>
 
 <h3 id="rendering">Rendering Model chapter</h3>
--- a/master/coords.html	Fri Aug 22 14:26:52 2014 +0100
+++ b/master/coords.html	Fri Aug 22 23:44:55 2014 +1000
@@ -1783,10 +1783,10 @@
 <dd class="operation">
 <div>
 Clears all existing current items from the list and re-initializes the
-list to hold the single item specified by the parameter.  If the inserted
-item is already in a list, it is removed from its previous list before
-it is inserted into this list.  The inserted item is the item itself and
-not a copy. 
+list to hold a single item specified by the parameter.  If <var>newItem</var>
+is in a list, then a new <a>SVGPoint</a> object is created with the same
+values as <var>newItem</var> and this item is inserted into the list.
+Otherwise, <var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -1872,11 +1872,10 @@
 <dd class="operation">
 <div>
 Inserts a new item into the list at the specified position. The first
-item is number 0. If <var>newItem</var> is already in a list, it is
-removed from its previous list before it is inserted into this list.
-The inserted item is the item itself and not a copy. If the item is
-already in this list, note that the index of the item to insert
-before is <i>before</i> the removal of the item.
+item is number 0. If <var>newItem</var> is already in a list, then
+a new <a>SVGPoint</a> object is created with the same values as
+<var>newItem</var> and this item is inserted into the list.  Otherwise,
+<var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -2573,10 +2572,10 @@
 <dd class="operation">
 <div>
 Clears all existing current items from the list and re-initializes the
-list to hold the single item specified by the parameter.  If the inserted
-item is already in a list, it is removed from its previous list before
-it is inserted into this list.  The inserted item is the item itself and
-not a copy. 
+list to hold a single item specified by the parameter.  If <var>newItem</var>
+is in a list, then a new <a>SVGTransform</a> object is created with the same
+values as <var>newItem</var> and this item is inserted into the list.
+Otherwise, <var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -2662,11 +2661,10 @@
 <dd class="operation">
 <div>
 Inserts a new item into the list at the specified position. The first
-item is number 0. If <var>newItem</var> is already in a list, it is
-removed from its previous list before it is inserted into this list.
-The inserted item is the item itself and not a copy. If the item is
-already in this list, note that the index of the item to insert
-before is <i>before</i> the removal of the item.
+item is number 0. If <var>newItem</var> is already in a list, then
+a new <a>SVGTransform</a> object is created with the same values as
+<var>newItem</var> and this item is inserted into the list.  Otherwise,
+<var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -2718,11 +2716,10 @@
 <dd class="operation">
 <div>
 Replaces an existing item in the list with a new item. If
-<var>newItem</var> is already in a list, it is removed from its
-previous list before it is inserted into this list.  The inserted item
-is the item itself and not a copy.  If the item is already in this
-list, note that the index of the item to replace is <i>before</i>
-the removal of the item.
+<var>newItem</var> is already in a list, then a new <a>SVGTransform</a>
+object is created with the same values as <var>newItem</var> and
+this item is inserted into the list.  Otherwise, <var>newItem</var>
+itself is inserted into the list.
 
 
 </div>
@@ -2827,9 +2824,10 @@
 <dd class="operation">
 <div>
 Inserts a new item at the end of the list. If <var>newItem</var> is
-already in a list, it is removed from its previous list before it is
-inserted into this list.  The inserted item is the item itself and
-not a copy.
+already in a list, then a new <a>SVGTransform</a> object is created
+with the same values as <var>newItem</var> and this item is inserted
+into the list.  Otherwise, <var>newItem</var> itself is inserted into
+the list.
 
 
 </div>
--- a/master/paths.html	Fri Aug 22 14:26:52 2014 +0100
+++ b/master/paths.html	Fri Aug 22 23:44:55 2014 +1000
@@ -2306,10 +2306,10 @@
 <dd class="operation">
 <div>
 Clears all existing current items from the list and re-initializes the
-list to hold the single item specified by the parameter.  If the inserted
-item is already in a list, it is removed from its previous list before
-it is inserted into this list.  The inserted item is the item itself and
-not a copy. 
+list to hold a single item specified by the parameter.  If <var>newItem</var>
+is in a list, then a new <a>SVGPathSeg</a> object is created with the same
+values as <var>newItem</var> and this item is inserted into the list.
+Otherwise, <var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -2395,11 +2395,10 @@
 <dd class="operation">
 <div>
 Inserts a new item into the list at the specified position. The first
-item is number 0. If <var>newItem</var> is already in a list, it is
-removed from its previous list before it is inserted into this list.
-The inserted item is the item itself and not a copy. If the item is
-already in this list, note that the index of the item to insert
-before is <i>before</i> the removal of the item.
+item is number 0. If <var>newItem</var> is already in a list, then
+a new <a>SVGPathSeg</a> object is created with the same values as
+<var>newItem</var> and this item is inserted into the list.  Otherwise,
+<var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -2451,11 +2450,10 @@
 <dd class="operation">
 <div>
 Replaces an existing item in the list with a new item. If
-<var>newItem</var> is already in a list, it is removed from its
-previous list before it is inserted into this list.  The inserted item
-is the item itself and not a copy.  If the item is already in this
-list, note that the index of the item to replace is <i>before</i>
-the removal of the item.
+<var>newItem</var> is already in a list, then a new <a>SVGPathSeg</a>
+object is created with the same values as <var>newItem</var> and
+this item is inserted into the list.  Otherwise, <var>newItem</var>
+itself is inserted into the list.
 
 
 </div>
@@ -2560,9 +2558,10 @@
 <dd class="operation">
 <div>
 Inserts a new item at the end of the list. If <var>newItem</var> is
-already in a list, it is removed from its previous list before it is
-inserted into this list.  The inserted item is the item itself and
-not a copy.
+already in a list, then a new <a>SVGPathSeg</a> object is created
+with the same values as <var>newItem</var> and this item is inserted
+into the list.  Otherwise, <var>newItem</var> itself is inserted into
+the list.
 
 
 </div>
--- a/master/types.html	Fri Aug 22 14:26:52 2014 +0100
+++ b/master/types.html	Fri Aug 22 23:44:55 2014 +1000
@@ -2206,10 +2206,10 @@
 <dd class="operation">
 <div>
 Clears all existing current items from the list and re-initializes the
-list to hold the single item specified by the parameter.  If the inserted
-item is already in a list, it is removed from its previous list before
-it is inserted into this list.  The inserted item is the item itself and
-not a copy. 
+list to hold a single item specified by the parameter.  If <var>newItem</var>
+is in a list, then a new <a>SVGNumber</a> object is created with the same
+values as <var>newItem</var> and this item is inserted into the list.
+Otherwise, <var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -2295,11 +2295,10 @@
 <dd class="operation">
 <div>
 Inserts a new item into the list at the specified position. The first
-item is number 0. If <var>newItem</var> is already in a list, it is
-removed from its previous list before it is inserted into this list.
-The inserted item is the item itself and not a copy. If the item is
-already in this list, note that the index of the item to insert
-before is <i>before</i> the removal of the item.
+item is number 0. If <var>newItem</var> is already in a list, then
+a new <a>SVGNumber</a> object is created with the same values as
+<var>newItem</var> and this item is inserted into the list.  Otherwise,
+<var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -2351,11 +2350,10 @@
 <dd class="operation">
 <div>
 Replaces an existing item in the list with a new item. If
-<var>newItem</var> is already in a list, it is removed from its
-previous list before it is inserted into this list.  The inserted item
-is the item itself and not a copy.  If the item is already in this
-list, note that the index of the item to replace is <i>before</i>
-the removal of the item.
+<var>newItem</var> is already in a list, then a new <a>SVGNumber</a>
+object is created with the same values as <var>newItem</var> and
+this item is inserted into the list.  Otherwise, <var>newItem</var>
+itself is inserted into the list.
 
 
 </div>
@@ -2460,9 +2458,10 @@
 <dd class="operation">
 <div>
 Inserts a new item at the end of the list. If <var>newItem</var> is
-already in a list, it is removed from its previous list before it is
-inserted into this list.  The inserted item is the item itself and
-not a copy.
+already in a list, then a new <a>SVGNumber</a> object is created
+with the same values as <var>newItem</var> and this item is inserted
+into the list.  Otherwise, <var>newItem</var> itself is inserted into
+the list.
 
 
 </div>
@@ -3035,10 +3034,10 @@
 <dd class="operation">
 <div>
 Clears all existing current items from the list and re-initializes the
-list to hold the single item specified by the parameter.  If the inserted
-item is already in a list, it is removed from its previous list before
-it is inserted into this list.  The inserted item is the item itself and
-not a copy.
+list to hold a single item specified by the parameter.  If <var>newItem</var>
+is in a list, then a new <a>SVGLength</a> object is created with the same
+values as <var>newItem</var> and this item is inserted into the list.
+Otherwise, <var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -3124,11 +3123,10 @@
 <dd class="operation">
 <div>
 Inserts a new item into the list at the specified position. The first
-item is number 0. If <var>newItem</var> is already in a list, it is
-removed from its previous list before it is inserted into this list.
-The inserted item is the item itself and not a copy. If the item is
-already in this list, note that the index of the item to insert
-before is <i>before</i> the removal of the item.
+item is number 0. If <var>newItem</var> is already in a list, then
+a new <a>SVGLength</a> object is created with the same values as
+<var>newItem</var> and this item is inserted into the list.  Otherwise,
+<var>newItem</var> itself is inserted into the list.
 
 
 </div>
@@ -3180,11 +3178,10 @@
 <dd class="operation">
 <div>
 Replaces an existing item in the list with a new item. If
-<var>newItem</var> is already in a list, it is removed from its
-previous list before it is inserted into this list.  The inserted item
-is the item itself and not a copy.  If the item is already in this
-list, note that the index of the item to replace is <i>before</i>
-the removal of the item.
+<var>newItem</var> is already in a list, then a new <a>SVGLength</a>
+object is created with the same values as <var>newItem</var> and
+this item is inserted into the list.  Otherwise, <var>newItem</var>
+itself is inserted into the list.
 
 
 </div>
@@ -3289,9 +3286,10 @@
 <dd class="operation">
 <div>
 Inserts a new item at the end of the list. If <var>newItem</var> is
-already in a list, it is removed from its previous list before it is
-inserted into this list.  The inserted item is the item itself and
-not a copy.
+already in a list, then a new <a>SVGLength</a> object is created
+with the same values as <var>newItem</var> and this item is inserted
+into the list.  Otherwise, <var>newItem</var> itself is inserted into
+the list.
 
 
 </div>