svg2: ACTION-3633: Add text for getPointAtLength and getPathSegAtLeng...

details:   https://svgwg.org/hg/svg2/rev/5f0c48cc0f64
branches:  
changeset: 687:5f0c48cc0f64
user:      Erik Dahlstrom <ed@opera.com>
date:      Thu Jun 26 18:21:36 2014 +0200
description:
ACTION-3633: Add text for getPointAtLength and getPathSegAtLength to describe behavior
for when there is no path data or when the index/length is beyond the ends of the path.

diffstat:

 master/changes.html |   3 +++
 master/paths.html   |  15 ++++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diffs (75 lines):

diff --git a/master/changes.html b/master/changes.html
--- a/master/changes.html
+++ b/master/changes.html
@@ -162,16 +162,19 @@ have been made.</p>
   from SVG Tiny 1.2, and an algorithm which can compute a bounding box for an element.</li>
 </ul>
 
 <h3 id="paths">Paths chapter</h3>
 
 <ul>
   <li>Added new <strong>B</strong> and
   <strong>b</strong> "bearing" path commands.</li>
+
+  <li class='added-since-last-wd'>Define how <a href="paths.html#__svg__SVGPathElement__getPathSegAtLength">getPathSegAtLength</a> and 
+  <a href="paths.html#__svg__SVGPathElement__getPointAtLength">getPointAtLength</a> handle out-of-range input, and what to do in case there's no valid path data.</li>
 </ul>
 
 <h3 id="text">Text chapter</h3>
 
 <ul>
   <li>Added a number of missing attributes to the element summary boxes of the
   <a>'text'</a> and <a>'textPath'</a> elements.</li>
 
diff --git a/master/paths.html b/master/paths.html
--- a/master/paths.html
+++ b/master/paths.html
@@ -2769,18 +2769,21 @@ in the current user coordinate system.
 </dd>
 
 <dt id="__svg__SVGPathElement__getPointAtLength" class="operation"><a>DOMPoint</a> <b>getPointAtLength</b>(float <var>distance</var>)
 </dt>
 <dd class="operation">
 <div>
 Returns the (x,y) coordinate in user space which is <var>distance</var>
 units along the path, utilizing the user agent's distance-along-a-path
-algorithm. 
-
+algorithm. The <var>distance</var> shall be clamped to the range 
+[0, <em>total-length-of-path</em>] before passing it to the distance-along-a-path algorithm.
+<p>
+If no valid path data exists, returns (0,0).
+</p>
 
 </div>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
 <div>float <var>distance</var></div> 
@@ -2801,19 +2804,21 @@ the path, as a distance in the current u
 </dd>
 
 <dt id="__svg__SVGPathElement__getPathSegAtLength" class="operation">unsigned long <b>getPathSegAtLength</b>(float <var>distance</var>)
 </dt>
 <dd class="operation">
 <div>
 Returns the index into <a>SVGAnimatedPathData::pathSegList</a> which is <var>distance</var>
 units along the path, utilizing the user agent's distance-along-a-path
-algorithm. 
-
-
+algorithm. The <var>distance</var> shall be clamped to the range 
+[0, <em>total-length-of-path</em>] before passing it to the distance-along-a-path algorithm.
+<p>
+If no valid path data exists, returns 0.
+</p>
 </div>
 <dl class="operation">
 <dt class="parameters-header">Parameters</dt>
 <dd>
 <ol class="parameters">
 <li class="parameter first-child">
 <div>float <var>distance</var></div> 
 <div> The distance along the path, relative to the start of

Received on Thursday, 26 June 2014 16:24:18 UTC