[html5] r7026 - [giow] (0) Add SVG paths to Path objects in canvas. Affected topics: Canvas

whatwg at whatwg.org whatwg at whatwg.org
Tue Mar 13 15:46:36 PDT 2012


Author: ianh
Date: 2012-03-13 15:46:35 -0700 (Tue, 13 Mar 2012)
New Revision: 7026

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Add SVG paths to Path objects in canvas.
Affected topics: Canvas

Modified: complete.html
===================================================================
--- complete.html	2012-03-13 19:33:56 UTC (rev 7025)
+++ complete.html	2012-03-13 22:46:35 UTC (rev 7026)
@@ -35015,6 +35015,7 @@
 
 [<a href=#dom-path title=dom-Path>Constructor</a>(optional <a href=#element>Element</a> scope)]
 interface <dfn id=path>Path</dfn> {
+  void <a href=#dom-path-addpathdata title=dom-path-addPathData>addPathData</a>(DOMString d);
   void <a href=#dom-path-addfill title=dom-path-addFill>addFill</a>(<a href=#path>Path</a> path);
   void <a href=#dom-path-addstroke title=dom-path-addStroke>addStroke</a>(<a href=#path>Path</a> path);
   void <span title=dom-path-addFillText>addFillText</span>(DOMString text, double x, double y, optional double maxWidth);
@@ -36252,6 +36253,14 @@
 
    </dd>
 
+   <dt><var title="">path</var> . <code title=dom-path-addPathData><a href=#dom-path-addpathdata>addPathData</a></code>(<var title="">d</var>)</dt>
+
+   <dd>
+
+    <p>Adds to the path the path described by the argument, interpreted as SVG path data. <a href=#refsSVG>[SVG]</a></p>
+
+   </dd>
+
    <dt><var title="">path</var> . <code title=dom-path-addFill><a href=#dom-path-addfill>addFill</a></code>(<var title="">path</var>)</dt>
    <dt><var title="">path</var> . <code title=dom-path-addStroke><a href=#dom-path-addstroke>addStroke</a></code>(<var title="">path</var>)</dt>
 
@@ -36286,7 +36295,32 @@
   <code><a href=#window>Window</a></code> object on which the interface object of the
   invoked constructor is found.</p>
 
-  <p>The <dfn id=dom-path-addfill title=dom-path-addFill><code>addFill(<var title="">b</var>)</code></dfn> method, when invoked on a
+
+  <p>The <dfn id=dom-path-addpathdata title=dom-path-addPathData><code>addPathData(<var title="">d</var>)</code> method must run the following steps:</dfn></p>
+
+  <ol><li><p>Parse and interpret the <var title="">d</var> argument
+   according to the SVG specification's rules for path data, thus
+   obtaining an SVG path. <a href=#refsSVG>[SVG]</a></li>
+
+   <li><p>If this failed in some way, then throw a
+   <code><a href=#syntaxerror>SyntaxError</a></code> exception, and abort these steps.</li>
+
+   <li><p>Transform all the coordinates and lines in the SVG path by
+   the <a href=#transformations title=dom-context-2d-transformation>current
+   transformation matrix</a> of the <code><a href=#path>Path</a></code>
+   object.</li>
+
+   <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
+   last point in the SVG path.</li>
+
+   <li><p>Add all the subpaths in the SVG path, if any, to the
+   <code><a href=#path>Path</a></code> object. </p>
+
+   <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with
+   (<var title="">x</var>, <var title="">y</var>) as the only point in
+   the subpath.</li>
+
+  </ol><p>The <dfn id=dom-path-addfill title=dom-path-addFill><code>addFill(<var title="">b</var>)</code></dfn> method, when invoked on a
   <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the
   following steps:</p>
 
@@ -36296,9 +36330,8 @@
    <li><p>Create a copy of all the subpaths in <var title="">b</var>.
    Let this copy be known as <var title="">c</var>.</li>
 
-   <li><p>Transform all the coordinates in <var title="">c</var> by
-   the <a href=#transformations title=dom-context-2d-transformation>current
-   transformation matrix</a> of <var title="">a</var>.</li>
+   <li><p>Transform all the coordinates and lines in <var title="">c</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+   matrix</a> of <var title="">a</var>.</li>
 
    <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
    last point in the last subpath of <var title="">c</var>.</li>
@@ -36318,9 +36351,8 @@
    <li><p>Create a copy of all the subpaths in <var title="">b</var>.
    Let this copy be known as <var title="">c</var>.</li>
 
-   <li><p>Transform all the coordinates in <var title="">c</var> by
-   the <a href=#transformations title=dom-context-2d-transformation>current
-   transformation matrix</a> of <var title="">a</var>.</li>
+   <li><p>Transform all the coordinates and lines in <var title="">c</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+   matrix</a> of <var title="">a</var>.</li>
 
    <li><p>Create a new list of subpaths <var title="">d</var>,
    consisting of the subpaths necessary to describe the result of
@@ -36405,8 +36437,7 @@
    These subpaths in <var title="">glyph subpaths</var> must also all
    wind clockwise.</p>
 
-   <li><p>Transform all the coordinates in <var title="">glyph
-   subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+   <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
    matrix</a> of the <code><a href=#path>Path</a></code> object.</li>
 
    <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the
@@ -36521,8 +36552,7 @@
      These subpaths in <var title="">glyph subpaths</var> must also
      all wind clockwise.</p>
 
-     <li><p>Transform all the coordinates in <var title="">glyph
-     subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+     <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
      matrix</a> of <var title="">target</var>.</li>
 
      <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in

Modified: index
===================================================================
--- index	2012-03-13 19:33:56 UTC (rev 7025)
+++ index	2012-03-13 22:46:35 UTC (rev 7026)
@@ -35015,6 +35015,7 @@
 
 [<a href=#dom-path title=dom-Path>Constructor</a>(optional <a href=#element>Element</a> scope)]
 interface <dfn id=path>Path</dfn> {
+  void <a href=#dom-path-addpathdata title=dom-path-addPathData>addPathData</a>(DOMString d);
   void <a href=#dom-path-addfill title=dom-path-addFill>addFill</a>(<a href=#path>Path</a> path);
   void <a href=#dom-path-addstroke title=dom-path-addStroke>addStroke</a>(<a href=#path>Path</a> path);
   void <span title=dom-path-addFillText>addFillText</span>(DOMString text, double x, double y, optional double maxWidth);
@@ -36252,6 +36253,14 @@
 
    </dd>
 
+   <dt><var title="">path</var> . <code title=dom-path-addPathData><a href=#dom-path-addpathdata>addPathData</a></code>(<var title="">d</var>)</dt>
+
+   <dd>
+
+    <p>Adds to the path the path described by the argument, interpreted as SVG path data. <a href=#refsSVG>[SVG]</a></p>
+
+   </dd>
+
    <dt><var title="">path</var> . <code title=dom-path-addFill><a href=#dom-path-addfill>addFill</a></code>(<var title="">path</var>)</dt>
    <dt><var title="">path</var> . <code title=dom-path-addStroke><a href=#dom-path-addstroke>addStroke</a></code>(<var title="">path</var>)</dt>
 
@@ -36286,7 +36295,32 @@
   <code><a href=#window>Window</a></code> object on which the interface object of the
   invoked constructor is found.</p>
 
-  <p>The <dfn id=dom-path-addfill title=dom-path-addFill><code>addFill(<var title="">b</var>)</code></dfn> method, when invoked on a
+
+  <p>The <dfn id=dom-path-addpathdata title=dom-path-addPathData><code>addPathData(<var title="">d</var>)</code> method must run the following steps:</dfn></p>
+
+  <ol><li><p>Parse and interpret the <var title="">d</var> argument
+   according to the SVG specification's rules for path data, thus
+   obtaining an SVG path. <a href=#refsSVG>[SVG]</a></li>
+
+   <li><p>If this failed in some way, then throw a
+   <code><a href=#syntaxerror>SyntaxError</a></code> exception, and abort these steps.</li>
+
+   <li><p>Transform all the coordinates and lines in the SVG path by
+   the <a href=#transformations title=dom-context-2d-transformation>current
+   transformation matrix</a> of the <code><a href=#path>Path</a></code>
+   object.</li>
+
+   <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
+   last point in the SVG path.</li>
+
+   <li><p>Add all the subpaths in the SVG path, if any, to the
+   <code><a href=#path>Path</a></code> object. </p>
+
+   <li><p>Create a new subpath in the <code><a href=#path>Path</a></code> object with
+   (<var title="">x</var>, <var title="">y</var>) as the only point in
+   the subpath.</li>
+
+  </ol><p>The <dfn id=dom-path-addfill title=dom-path-addFill><code>addFill(<var title="">b</var>)</code></dfn> method, when invoked on a
   <code><a href=#path>Path</a></code> object <var title="">a</var>, must run the
   following steps:</p>
 
@@ -36296,9 +36330,8 @@
    <li><p>Create a copy of all the subpaths in <var title="">b</var>.
    Let this copy be known as <var title="">c</var>.</li>
 
-   <li><p>Transform all the coordinates in <var title="">c</var> by
-   the <a href=#transformations title=dom-context-2d-transformation>current
-   transformation matrix</a> of <var title="">a</var>.</li>
+   <li><p>Transform all the coordinates and lines in <var title="">c</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+   matrix</a> of <var title="">a</var>.</li>
 
    <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
    last point in the last subpath of <var title="">c</var>.</li>
@@ -36318,9 +36351,8 @@
    <li><p>Create a copy of all the subpaths in <var title="">b</var>.
    Let this copy be known as <var title="">c</var>.</li>
 
-   <li><p>Transform all the coordinates in <var title="">c</var> by
-   the <a href=#transformations title=dom-context-2d-transformation>current
-   transformation matrix</a> of <var title="">a</var>.</li>
+   <li><p>Transform all the coordinates and lines in <var title="">c</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+   matrix</a> of <var title="">a</var>.</li>
 
    <li><p>Create a new list of subpaths <var title="">d</var>,
    consisting of the subpaths necessary to describe the result of
@@ -36405,8 +36437,7 @@
    These subpaths in <var title="">glyph subpaths</var> must also all
    wind clockwise.</p>
 
-   <li><p>Transform all the coordinates in <var title="">glyph
-   subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+   <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
    matrix</a> of the <code><a href=#path>Path</a></code> object.</li>
 
    <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in the
@@ -36521,8 +36552,7 @@
      These subpaths in <var title="">glyph subpaths</var> must also
      all wind clockwise.</p>
 
-     <li><p>Transform all the coordinates in <var title="">glyph
-     subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
+     <li><p>Transform all the coordinates and lines in <var title="">glyph subpaths</var> by the <a href=#transformations title=dom-context-2d-transformation>current transformation
      matrix</a> of <var title="">target</var>.</li>
 
      <li><p>Let (<var title="">x<sub title="">final</sub></var>, <var title="">y<sub title="">final</sub></var>) be the last point in

Modified: source
===================================================================
--- source	2012-03-13 19:33:56 UTC (rev 7025)
+++ source	2012-03-13 22:46:35 UTC (rev 7026)
@@ -40694,6 +40694,7 @@
 
 [<span title="dom-Path">Constructor</span>(optional <span>Element</span> scope)]
 interface <dfn>Path</dfn> {
+  void <span title="dom-path-addPathData">addPathData</span>(DOMString d);
   void <span title="dom-path-addFill">addFill</span>(<span>Path</span> path);
   void <span title="dom-path-addStroke">addStroke</span>(<span>Path</span> path);
   void <span title="dom-path-addFillText">addFillText</span>(DOMString text, double x, double y, optional double maxWidth);
@@ -42165,6 +42166,14 @@
 
    </dd>
 
+   <dt><var title="">path</var> . <code title="dom-path-addPathData">addPathData</code>(<var title="">d</var>)</dt>
+
+   <dd>
+
+    <p>Adds to the path the path described by the argument, interpreted as SVG path data. <a href="#refsSVG">[SVG]</a></p>
+
+   </dd>
+
    <dt><var title="">path</var> . <code title="dom-path-addFill">addFill</code>(<var title="">path</var>)</dt>
    <dt><var title="">path</var> . <code title="dom-path-addStroke">addStroke</code>(<var title="">path</var>)</dt>
 
@@ -42201,6 +42210,37 @@
   <code>Window</code> object on which the interface object of the
   invoked constructor is found.</p>
 
+
+  <p>The <dfn title="dom-path-addPathData"><code>addPathData(<var
+  title="">d</var>)</code> method must run the following steps:</p>
+
+  <ol>
+
+   <li><p>Parse and interpret the <var title="">d</var> argument
+   according to the SVG specification's rules for path data, thus
+   obtaining an SVG path. <a href="#refsSVG">[SVG]</a></p></li>
+
+   <li><p>If this failed in some way, then throw a
+   <code>SyntaxError</code> exception, and abort these steps.</p></li>
+
+   <li><p>Transform all the coordinates and lines in the SVG path by
+   the <span title="dom-context-2d-transformation">current
+   transformation matrix</span> of the <code>Path</code>
+   object.</p></li>
+
+   <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
+   last point in the SVG path.</p></li>
+
+   <li><p>Add all the subpaths in the SVG path, if any, to the
+   <code>Path</code> object. </p>
+
+   <li><p>Create a new subpath in the <code>Path</code> object with
+   (<var title="">x</var>, <var title="">y</var>) as the only point in
+   the subpath.</p></li>
+
+  </ol>
+
+
   <p>The <dfn title="dom-path-addFill"><code>addFill(<var
   title="">b</var>)</code></dfn> method, when invoked on a
   <code>Path</code> object <var title="">a</var>, must run the
@@ -42214,9 +42254,10 @@
    <li><p>Create a copy of all the subpaths in <var title="">b</var>.
    Let this copy be known as <var title="">c</var>.</p></li>
 
-   <li><p>Transform all the coordinates in <var title="">c</var> by
-   the <span title="dom-context-2d-transformation">current
-   transformation matrix</span> of <var title="">a</var>.</p></li>
+   <li><p>Transform all the coordinates and lines in <var
+   title="">c</var> by the <span
+   title="dom-context-2d-transformation">current transformation
+   matrix</span> of <var title="">a</var>.</p></li>
 
    <li><p>Let (<var title="">x</var>, <var title="">y</var>) be the
    last point in the last subpath of <var title="">c</var>.</p></li>
@@ -42243,9 +42284,10 @@
    <li><p>Create a copy of all the subpaths in <var title="">b</var>.
    Let this copy be known as <var title="">c</var>.</p></li>
 
-   <li><p>Transform all the coordinates in <var title="">c</var> by
-   the <span title="dom-context-2d-transformation">current
-   transformation matrix</span> of <var title="">a</var>.</p></li>
+   <li><p>Transform all the coordinates and lines in <var
+   title="">c</var> by the <span
+   title="dom-context-2d-transformation">current transformation
+   matrix</span> of <var title="">a</var>.</p></li>
 
    <li><p>Create a new list of subpaths <var title="">d</var>,
    consisting of the subpaths necessary to describe the result of
@@ -42353,8 +42395,8 @@
    These subpaths in <var title="">glyph subpaths</var> must also all
    wind clockwise.</p>
 
-   <li><p>Transform all the coordinates in <var title="">glyph
-   subpaths</var> by the <span
+   <li><p>Transform all the coordinates and lines in <var
+   title="">glyph subpaths</var> by the <span
    title="dom-context-2d-transformation">current transformation
    matrix</span> of the <code>Path</code> object.</p></li>
 
@@ -42500,8 +42542,8 @@
      These subpaths in <var title="">glyph subpaths</var> must also
      all wind clockwise.</p>
 
-     <li><p>Transform all the coordinates in <var title="">glyph
-     subpaths</var> by the <span
+     <li><p>Transform all the coordinates and lines in <var
+     title="">glyph subpaths</var> by the <span
      title="dom-context-2d-transformation">current transformation
      matrix</span> of <var title="">target</var>.</p></li>
 




More information about the Commit-Watchers mailing list