[html5] r3476 - [gow] (2) Change how lineTo(), arcTo(), quadraticCurveTo(), and bezierCurveTo() [...]
whatwg at whatwg.org
whatwg at whatwg.org
Mon Jul 27 16:47:57 PDT 2009
Author: ianh
Date: 2009-07-27 16:47:55 -0700 (Mon, 27 Jul 2009)
New Revision: 3476
Modified:
index
source
Log:
[gow] (2) Change how lineTo(), arcTo(), quadraticCurveTo(), and bezierCurveTo() behave when there's not been a moveTo() call before them.
Modified: index
===================================================================
--- index 2009-07-27 23:23:29 UTC (rev 3475)
+++ index 2009-07-27 23:47:55 UTC (rev 3476)
@@ -24312,48 +24312,58 @@
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
using the methods described below. In all cases, the methods only
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é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é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=#refsBEZIER>[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é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é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=#refsBEZIER>[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>
@@ -24389,8 +24399,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
@@ -24432,8 +24441,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
Modified: source
===================================================================
--- source 2009-07-27 23:23:29 UTC (rev 3475)
+++ source 2009-07-27 23:47:55 UTC (rev 3476)
@@ -26511,52 +26511,68 @@
create a new subpath with the specified point as its first (and
only) point.</p>
+ <p>When the user agent is to <dfn>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">moveTo()</code> method had been
+ called.</p>
+
<p>The <dfn
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">moveTo()</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">moveTo()</code> call.</p>
+
<p>New points and the lines connecting them are added to subpaths
using the methods described below. In all cases, the methods only
modify the last subpath in the context's paths.</p>
<p>The <dfn 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>
+ title="">x</var>, <var title="">y</var>)</code></dfn> method must
+ <span>ensure there is a subpath</span> 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
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
+ <var title="">y</var>)</code></dfn> method must <span>ensure there
+ is a subpath</span> 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é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="#refsBEZIER">[BEZIER]</a></p>
+ title="">y</var>) to the subpath. <a
+ href="#refsBEZIER">[BEZIER]</a></p>
<p>The <dfn
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>)</code></dfn> method must
+ <span>ensure there is a subpath</span> 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ézier
curve with control points (<var title="">cp1x</var>, <var
title="">cp1y</var>) and (<var title="">cp2x</var>, <var
@@ -26564,13 +26580,15 @@
title="">x</var>, <var title="">y</var>) to the subpath. <a
href="#refsBEZIER">[BEZIER]</a></p>
+ <hr>
<p>The <dfn 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 <span>ensure there is a subpath</span> 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>INDEX_SIZE_ERR</code>
@@ -26616,6 +26634,7 @@
title="">The Arc</var>, adding the end tangent point to the
subpath.</p>
+ <hr>
<p>The <dfn title="dom-context-2d-arc"><code>arc(<var
title="">x</var>, <var title="">y</var>, <var title="">radius</var>,
@@ -26664,6 +26683,7 @@
implementation to raise an <code>INDEX_SIZE_ERR</code>
exception.</p>
+ <hr>
<p>The <dfn title="dom-context-2d-rect"><code>rect(<var
title="">x</var>, <var title="">y</var>, <var title="">w</var>, <var
More information about the Commit-Watchers
mailing list