W3C home > Mailing lists > Public > public-html-diffs@w3.org > July 2009

hixie: Change how lineTo(), arcTo(), quadraticCurveTo(), and bezierCurveTo() behave when there's not been a moveTo() call before them. (whatwg r3476)

From: poot <cvsmail@w3.org>
Date: Tue, 28 Jul 2009 08:48:24 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20090727234824.BA87E2BBFC@toro.w3.mag.keio.ac.jp>
hixie: Change how lineTo(), arcTo(), quadraticCurveTo(), and
bezierCurveTo() behave when there's not been a moveTo() call before
them. (whatwg r3476)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.2678&r2=1.2679&f=h
http://html5.org/tools/web-apps-tracker?from=3475&to=3476

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.2678
retrieving revision 1.2679
diff -u -d -r1.2678 -r1.2679
--- Overview.html	27 Jul 2009 23:23:35 -0000	1.2678
+++ Overview.html	27 Jul 2009 23:48:02 -0000	1.2679
@@ -21411,16 +21411,25 @@
   create a new subpath with the specified point as its first (and
   only) point.</p>
 
+  <p>When the user agent is to <dfn id="ensure-there-is-a-subpath">ensure there is a subpath</dfn>
+  for a coordinate (<var title="">x</var>, <var title="">y</var>), the
+  user agent must check to see if the context has any subpaths, and if
+  it does not, then the user agent must create a new subpath with the
+  point (<var title="">x</var>, <var title="">y</var>) as its first
+  (and only) point, as if the <code title="dom-context-2d-moveTo"><a href="#dom-context-2d-moveto">moveTo()</a></code> method had been
+  called.</p>
+
 
   <p>The <dfn id="dom-context-2d-closepath" title="dom-context-2d-closePath"><code>closePath()</code></dfn>
   method must do nothing if the context has no subpaths. Otherwise, it
   must mark the last subpath as closed, create a new subpath whose
   first point is the same as the previous subpath's first point, and
-  finally add this new subpath to the path. (If the last subpath had
-  more than one point in its list of points, then this is equivalent
-  to adding a straight line connecting the last point back to the
-  first point, thus "closing" the shape, and then repeating the last
-  <code title="dom-context-2d-moveTo"><a href="#dom-context-2d-moveto">moveTo()</a></code> call.)</p>
+  finally add this new subpath to the path.</p>
+
+  <p class="note">If the last subpath had more than one point in its
+  list of points, then this is equivalent to adding a straight line
+  connecting the last point back to the first point, thus "closing"
+  the shape, and then repeating the last (possibly implied) <code title="dom-context-2d-moveTo"><a href="#dom-context-2d-moveto">moveTo()</a></code> call.</p>
 
 
   <p>New points and the lines connecting them are added to subpaths
@@ -21428,31 +21437,32 @@
   modify the last subpath in the context's paths.</p>
 
 
-  <p>The <dfn id="dom-context-2d-lineto" title="dom-context-2d-lineTo"><code>lineTo(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must do
-  nothing if the context has no subpaths. Otherwise, it must connect
-  the last point in the subpath to the given point (<var title="">x</var>, <var title="">y</var>) using a straight line, and
-  must then add the given point (<var title="">x</var>, <var title="">y</var>) to the subpath.</p>
+  <p>The <dfn id="dom-context-2d-lineto" title="dom-context-2d-lineTo"><code>lineTo(<var title="">x</var>, <var title="">y</var>)</code></dfn> method must
+  <a href="#ensure-there-is-a-subpath">ensure there is a subpath</a> for <span title="">(<var title="">x</var>, <var title="">y</var>)</span> if the context has
+  no subpaths. Otherwise, it must connect the last point in the
+  subpath to the given point (<var title="">x</var>, <var title="">y</var>) using a straight line, and must then add the given
+  point (<var title="">x</var>, <var title="">y</var>) to the
+  subpath.</p>
 
 
   <p>The <dfn id="dom-context-2d-quadraticcurveto" title="dom-context-2d-quadraticCurveTo"><code>quadraticCurveTo(<var title="">cpx</var>, <var title="">cpy</var>, <var title="">x</var>,
-  <var title="">y</var>)</code></dfn> method must do nothing if the
-  context has no subpaths. Otherwise it must connect the last point in
-  the subpath to the given point (<var title="">x</var>, <var title="">y</var>) using a quadratic B&eacute;zier curve with control
+  <var title="">y</var>)</code></dfn> method must <a href="#ensure-there-is-a-subpath">ensure there
+  is a subpath</a> for <span title="">(<var title="">cpx</var>,
+  <var title="">cpy</var>)</span>, and then must connect the last
+  point in the subpath to the given point (<var title="">x</var>, <var title="">y</var>) using a quadratic B&eacute;zier curve with control
   point (<var title="">cpx</var>, <var title="">cpy</var>), and must
   then add the given point (<var title="">x</var>, <var title="">y</var>) to the subpath. <a href="#references">[BEZIER]</a></p>
 
 
-  <p>The <dfn id="dom-context-2d-beziercurveto" title="dom-context-2d-bezierCurveTo"><code>bezierCurveTo(<var title="">cp1x</var>, <var title="">cp1y</var>, <var title="">cp2x</var>, <var title="">cp2y</var>, <var title="">x</var>, <var title="">y</var>)</code></dfn> method must do
-  nothing if the context has no subpaths. Otherwise, it must connect
-  the last point in the subpath to the given point (<var title="">x</var>, <var title="">y</var>) using a cubic B&eacute;zier
+  <p>The <dfn id="dom-context-2d-beziercurveto" title="dom-context-2d-bezierCurveTo"><code>bezierCurveTo(<var title="">cp1x</var>, <var title="">cp1y</var>, <var title="">cp2x</var>, <var title="">cp2y</var>, <var title="">x</var>, <var title="">y</var>)</code></dfn> method must
+  <a href="#ensure-there-is-a-subpath">ensure there is a subpath</a> for <span title="">(<var title="">cp1x</var>, <var title="">cp1y</var>)</span>, and then must
+  connect the last point in the subpath to the given point (<var title="">x</var>, <var title="">y</var>) using a cubic B&eacute;zier
   curve with control points (<var title="">cp1x</var>, <var title="">cp1y</var>) and (<var title="">cp2x</var>, <var title="">cp2y</var>). Then, it must add the point (<var title="">x</var>, <var title="">y</var>) to the subpath. <a href="#references">[BEZIER]</a></p>
 
-
-  <p>The <dfn id="dom-context-2d-arcto" title="dom-context-2d-arcTo"><code>arcTo(<var title="">x1</var>, <var title="">y1</var>, <var title="">x2</var>,
+  <hr><p>The <dfn id="dom-context-2d-arcto" title="dom-context-2d-arcTo"><code>arcTo(<var title="">x1</var>, <var title="">y1</var>, <var title="">x2</var>,
   <var title="">y2</var>, <var title="">radius</var>)</code></dfn>
-  method must do nothing if the context has no subpaths. If the
-  context <em>does</em> have a subpath, then the behavior depends on
-  the arguments and the last point in the subpath.</p>
+  method must first <a href="#ensure-there-is-a-subpath">ensure there is a subpath</a> for <span title="">(<var title="">x1</var>, <var title="">y1</var>)</span>. Then, the behavior depends on the
+  arguments and the last point in the subpath, as described below.</p>
 
   <p>Negative values for <var title="">radius</var> must cause the
   implementation to raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code>
@@ -21488,8 +21498,7 @@
   the start tangent point to the end tangent point by <var title="">The Arc</var>, adding the end tangent point to the
   subpath.</p>
 
-
-  <p>The <dfn id="dom-context-2d-arc" title="dom-context-2d-arc"><code>arc(<var title="">x</var>, <var title="">y</var>, <var title="">radius</var>,
+  <hr><p>The <dfn id="dom-context-2d-arc" title="dom-context-2d-arc"><code>arc(<var title="">x</var>, <var title="">y</var>, <var title="">radius</var>,
   <var title="">startAngle</var>, <var title="">endAngle</var>, <var title="">anticlockwise</var>)</code></dfn> method draws an arc. If
   the context has any subpaths, then the method must add a straight
   line from the last point in the subpath to the start point of the
@@ -21531,8 +21540,7 @@
   implementation to raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code>
   exception.</p>
 
-
-  <p>The <dfn id="dom-context-2d-rect" title="dom-context-2d-rect"><code>rect(<var title="">x</var>, <var title="">y</var>, <var title="">w</var>, <var title="">h</var>)</code></dfn> method must create a new subpath
+  <hr><p>The <dfn id="dom-context-2d-rect" title="dom-context-2d-rect"><code>rect(<var title="">x</var>, <var title="">y</var>, <var title="">w</var>, <var title="">h</var>)</code></dfn> method must create a new subpath
   containing just the four points (<var title="">x</var>, <var title="">y</var>), (<var title="">x</var>+<var title="">w</var>,
   <var title="">y</var>), (<var title="">x</var>+<var title="">w</var>, <var title="">y</var>+<var title="">h</var>),
   (<var title="">x</var>, <var title="">y</var>+<var title="">h</var>), with those four points connected by straight
Received on Monday, 27 July 2009 23:49:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 06:14:07 GMT