HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/7026

SVNBugCommentTime (UTC)
7026[Gecko] [Internet Explorer] [Opera] [Webkit] Add SVG paths to Path objects in canvas.2012-03-13 22:46
Index: source
===================================================================
--- source	(revision 7025)
+++ source	(revision 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>
 

|