svg2: Make list object methods make a copy of a list item being inser...

details:   https://svgwg.org/hg/svg2/rev/ff12055fb012
branches:  
changeset: 696:ff12055fb012
user:      Cameron McCormack <cam@mcc.id.au>
date:      Fri Aug 22 23:44:55 2014 +1000
description:
Make list object methods make a copy of a list item being inserted if it's already in a list. (ACTION-3634)

diffstat:

 master/changes.html |   4 +++
 master/coords.html  |  50 +++++++++++++++++++--------------------
 master/paths.html   |  33 ++++++++++++-------------
 master/types.html   |  66 +++++++++++++++++++++++++---------------------------
 4 files changed, 76 insertions(+), 77 deletions(-)

diffs (488 lines):

diff --git a/master/changes.html b/master/changes.html
--- a/master/changes.html
+++ b/master/changes.html
@@ -54,16 +54,20 @@ have been made.</p>
 
   <li>Added "length" attribute and indexed property access to all list interfaces.</li>
 
   <li>Remove definition of <a>&lt;angle&gt;</a> type and reference CSS3-values.</li>
 
   <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>
 <ul>
   <li>Update rendering model to refer to <a href="http://www.w3.org/TR/compositing/">Compositing and Blending Specification</a>.</li>
 </ul>
 
 <h3 id="types">Basic Data Types and Interfaces chapter</h3>
diff --git a/master/coords.html b/master/coords.html
--- a/master/coords.html
+++ b/master/coords.html
@@ -1778,20 +1778,20 @@ cannot be modified.
 </dl>
 </dd>
 
 <dt id="__svg__SVGPointList__initialize" class="operation"><a>DOMPoint</a> <b>initialize</b>(<a>DOMPoint</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -1867,21 +1867,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGPointList__insertItemBefore" class="operation"><a>DOMPoint</a> <b>insertItemBefore</b>(<a>DOMPoint</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2568,20 +2567,20 @@ an empty list.
 </dl>
 </dd>
 
 <dt id="__svg__SVGTransformList__initialize" class="operation"><a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <b>initialize</b>(<a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2657,21 +2656,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGTransformList__insertItemBefore" class="operation"><a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <b>insertItemBefore</b>(<a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2713,21 +2711,20 @@ appended to the end of the list.
 </dl>
 </dd>
 
 <dt id="__svg__SVGTransformList__replaceItem" class="operation"><a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <b>replaceItem</b>(<a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2822,19 +2819,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGTransformList__appendItem" class="operation"><a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <b>appendItem</b>(<a class="idlinterface" href="coords.html#InterfaceSVGTransform">SVGTransform</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
diff --git a/master/paths.html b/master/paths.html
--- a/master/paths.html
+++ b/master/paths.html
@@ -2301,20 +2301,20 @@ cannot be modified.
 </dl>
 </dd>
 
 <dt id="__svg__SVGPathSegList__initialize" class="operation"><a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <b>initialize</b>(<a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2390,21 +2390,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGPathSegList__insertItemBefore" class="operation"><a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <b>insertItemBefore</b>(<a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2446,21 +2445,20 @@ cannot be modified.
 </dl>
 </dd>
 
 <dt id="__svg__SVGPathSegList__replaceItem" class="operation"><a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <b>replaceItem</b>(<a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2555,19 +2553,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGPathSegList__appendItem" class="operation"><a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <b>appendItem</b>(<a class="idlinterface" href="paths.html#InterfaceSVGPathSeg">SVGPathSeg</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
diff --git a/master/types.html b/master/types.html
--- a/master/types.html
+++ b/master/types.html
@@ -2201,20 +2201,20 @@ an empty list.
 </dl>
 </dd>
 
 <dt id="__svg__SVGNumberList__initialize" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <b>initialize</b>(<a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2290,21 +2290,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGNumberList__insertItemBefore" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <b>insertItemBefore</b>(<a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2346,21 +2345,20 @@ appended to the end of the list.
 </dl>
 </dd>
 
 <dt id="__svg__SVGNumberList__replaceItem" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <b>replaceItem</b>(<a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -2455,19 +2453,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGNumberList__appendItem" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <b>appendItem</b>(<a class="idlinterface" href="types.html#InterfaceSVGNumber">SVGNumber</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -3030,20 +3029,20 @@ an empty list.
 </dl>
 </dd>
 
 <dt id="__svg__SVGLengthList__initialize" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <b>initialize</b>(<a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -3119,21 +3118,20 @@ returned.  The first item is number 0.
 </dl>
 </dd>
 
 <dt id="__svg__SVGLengthList__insertItemBefore" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <b>insertItemBefore</b>(<a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -3175,21 +3173,20 @@ appended to the end of the list.
 </dl>
 </dd>
 
 <dt id="__svg__SVGLengthList__replaceItem" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <b>replaceItem</b>(<a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <var>newItem</var>, unsigned long <var>index</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
@@ -3284,19 +3281,20 @@ greater than or equal to <a>numberOfItem
 </dl>
 </dd>
 
 <dt id="__svg__SVGLengthList__appendItem" class="operation"><a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <b>appendItem</b>(<a class="idlinterface" href="types.html#InterfaceSVGLength">SVGLength</a> <var>newItem</var>)
 </dt>
 <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>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">

Received on Friday, 22 August 2014 13:48:06 UTC