W3C home > Mailing lists > Public > public-html-commits@w3.org > September 2012

html5/2dcontext Overview.html,1.171,1.172

From: Sam Ruby via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 25 Sep 2012 02:14:41 +0000
To: public-html-commits@w3.org
Message-Id: <E1TGKfZ-000588-UZ@lionel-hutz.w3.org>
Update of /sources/public/html5/2dcontext
In directory hutz:/tmp/cvs-serv19706

Modified Files:
	Overview.html 
Log Message:
commit 2bd6ae47428ed21613b43cdda96bebd95b3c683b
Author: Jay Munro <jaymunro@microsoft.com>
Date:   Mon Sep 24 18:49:13 2012 -0700

    Revert "Removed dashed lines"
    
    This reverts commit 2026a65a3d3069ba009fc8d02cf6c22c6a67ba1c.


Index: Overview.html
===================================================================
RCS file: /sources/public/html5/2dcontext/Overview.html,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- Overview.html	24 Sep 2012 23:45:03 -0000	1.171
+++ Overview.html	25 Sep 2012 02:14:39 -0000	1.172
@@ -324,7 +324,7 @@
 
    <h1>HTML Canvas 2D Context</h1>
    <h2 class="no-num no-toc" id=generatedID></h2>
-   <h2 class="no-num no-toc" id="editor's-draft-date-1-january-1970">Editor's Draft 24 September 2012</h2>
+   <h2 class="no-num no-toc" id="editor's-draft-date-1-january-1970">Editor's Draft 25 September 2012</h2>
    <dl><dt>Latest Published Version:</dt>
     <dd><a href=http://www.w3.org/TR/2dcontext/>http://www.w3.org/TR/2dcontext/</a></dd>
     <dt>Latest Editor's Draft:</dt>
@@ -447,7 +447,7 @@
   Group</a> is the W3C working group responsible for this
   specification's progress along the W3C Recommendation
   track.
-  This specification is the 24 September 2012 Editor's Draft.
+  This specification is the 25 September 2012 Editor's Draft.
   </p>
 
 
@@ -649,6 +649,11 @@
            attribute DOMString <a href=#dom-context-2d-linejoin title=dom-context-2d-lineJoin>lineJoin</a>; // "round", "bevel", "miter" (default "miter")
            attribute unrestricted double <a href=#dom-context-2d-miterlimit title=dom-context-2d-miterLimit>miterLimit</a>; // (default 10)
 
+  // dashed lines
+  void <a href=#dom-context-2d-setlinedash title=dom-context-2d-setLineDash>setLineDash</a>(sequence&lt;unrestricted double&gt; segments); // default empty
+  sequence&lt;unrestricted double&gt; <a href=#dom-context-2d-getlinedash title=dom-context-2d-getLineDash>getLineDash</a>();
+           attribute unrestricted double <a href=#dom-context-2d-linedashoffset title=dom-context-2d-lineDashOffset>lineDashOffset</a>;
+
   // text
            attribute DOMString <a href=#dom-context-2d-font title=dom-context-2d-font>font</a>; // (default 10px sans-serif)
            attribute DOMString <a href=#dom-context-2d-textalign title=dom-context-2d-textAlign>textAlign</a>; // "start", "end", "left", "right", "center" (default: "start")
@@ -789,8 +794,8 @@
 
   <ul class=brief><li>The current <a href=#transformations title=dom-context-2d-transformation>transformation matrix</a>.</li>
    <li>The current <a href=#clipping-region>clipping region</a>.</li>
-   <li>The current values of the following attributes: <code title=dom-context-2d-strokeStyle><a href=#dom-context-2d-strokestyle>strokeStyle</a></code>, <code title=dom-context-2d-fillStyle><a href=#dom-context-2d-fillstyle>fillStyle</a></code>, <code title=dom-context-2d-globalAlpha><a href=#dom-context-2d-globalalpha>globalAlpha</a></code>, <code title=dom-context-2d-lineWidth><a href=#dom-context-2d-linewidth>lineWidth</a></code>, <code title=dom-context-2d-lineCap><a href=#dom-context-2d-linecap>lineCap</a></code>, <code title=dom-context-2d-lineJoin><a href=#dom-context-2d-linejoin>lineJoin</a></code>, <code title=dom-context-2d-miterLimit><a href=#dom-context-2d-miterlimit>miterLimit</a></code>, <code title=dom-context-2d-lineDashOffset>lineDashOffset</code>, <code title=dom-context-2d-shadowOffsetX><a href=#dom-context-2d-shadowoffsetx>shadowOffsetX</a></code>, <code title=dom-context-2d-shadowOffsetY><a href=#dom-context-2d-shadowoffsety>shadowOffsetY</a></code>, <code title=dom-context-2d-shadowBlur><a href=#dom-context-2d-shadowblur>shadowBlur</a></code>, <code title=dom-context-2d-shadowColor><a href=#dom-context-2d-shadowcolor>shadowColor</a></code>, <code title=dom-context-2d-globalCompositeOperation><a href=#dom-context-2d-globalcompositeoperation>globalCompositeOperation</a></code>, <code title=dom-context-2d-font><a href=#dom-context-2d-font>font</a></code>, <code title=dom-context-2d-textAlign><a href=#dom-context-2d-textalign>textAlign</a></code>, <code title=dom-context-2d-textBaseline><a href=#dom-context-2d-textbaseline>textBaseline</a></code>.</li>
-   <li>The current <span>dash list</span>.</li>
+   <li>The current values of the following attributes: <code title=dom-context-2d-strokeStyle><a href=#dom-context-2d-strokestyle>strokeStyle</a></code>, <code title=dom-context-2d-fillStyle><a href=#dom-context-2d-fillstyle>fillStyle</a></code>, <code title=dom-context-2d-globalAlpha><a href=#dom-context-2d-globalalpha>globalAlpha</a></code>, <code title=dom-context-2d-lineWidth><a href=#dom-context-2d-linewidth>lineWidth</a></code>, <code title=dom-context-2d-lineCap><a href=#dom-context-2d-linecap>lineCap</a></code>, <code title=dom-context-2d-lineJoin><a href=#dom-context-2d-linejoin>lineJoin</a></code>, <code title=dom-context-2d-miterLimit><a href=#dom-context-2d-miterlimit>miterLimit</a></code>, <code title=dom-context-2d-lineDashOffset><a href=#dom-context-2d-linedashoffset>lineDashOffset</a></code>, <code title=dom-context-2d-shadowOffsetX><a href=#dom-context-2d-shadowoffsetx>shadowOffsetX</a></code>, <code title=dom-context-2d-shadowOffsetY><a href=#dom-context-2d-shadowoffsety>shadowOffsetY</a></code>, <code title=dom-context-2d-shadowBlur><a href=#dom-context-2d-shadowblur>shadowBlur</a></code>, <code title=dom-context-2d-shadowColor><a href=#dom-context-2d-shadowcolor>shadowColor</a></code>, <code title=dom-context-2d-globalCompositeOperation><a href=#dom-context-2d-globalcompositeoperation>globalCompositeOperation</a></code>, <code title=dom-context-2d-font><a href=#dom-context-2d-font>font</a></code>, <code title=dom-context-2d-textAlign><a href=#dom-context-2d-textalign>textAlign</a></code>, <code title=dom-context-2d-textBaseline><a href=#dom-context-2d-textbaseline>textBaseline</a></code>.</li>
+   <li>The current <a href=#dash-list>dash list</a>.</li>
   </ul><p class=note>The <a href=#current-default-path>current default path</a> and the
   current bitmap are not part of the drawing state. The <a href=#current-default-path>current
   default path</a> is persistent, and can only be reset using the
@@ -939,6 +944,43 @@
 
    </dd>
 
+
+   <dt><var title="">context</var> . <code title=dom-context-2d-setLineDash><a href=#dom-context-2d-setlinedash>setLineDash</a></code>(<var title="">segments</var>)</dt>
+   <dt><var title="">styles</var> . <code title=dom-context-2d-setLineDash><a href=#dom-context-2d-setlinedash>setLineDash</a></code>(<var title="">segments</var>)</dt>
+
+   <dd>
+
+    <p>Sets the current line dash pattern (as used when stroking). The
+    argument is an array of distances for which to alternately have
+    the line on and the line off.</p>
+
+   </dd>
+
+
+   <dt><var title="">segments</var> = <var title="">context</var> . <code title=dom-context-2d-getLineDash><a href=#dom-context-2d-getlinedash>getLineDash</a></code>()</dt>
+   <dt><var title="">segments</var> = <var title="">styles</var> . <code title=dom-context-2d-getLineDash><a href=#dom-context-2d-getlinedash>getLineDash</a></code>()</dt>
+
+   <dd>
+
+    <p>Returns a copy of the current line dash pattern. The array
+    returned will always have an even number of entries (i.e. the
+    pattern is normalized).</p>
+
+   </dd>
+
+
+   <dt><var title="">context</var> . <code title=dom-context-2d-lineDashOffset><a href=#dom-context-2d-linedashoffset>lineDashOffset</a></code></dt>
+   <dt><var title="">styles</var> . <code title=dom-context-2d-lineDashOffset><a href=#dom-context-2d-linedashoffset>lineDashOffset</a></code></dt>
+
+   <dd>
+
+    <p>Returns the phase offset (in the same units as the line dash pattern).</p>
+
+    <p>Can be set, to change the phase offset. Values that are not
+    finite values are ignored.</p>
+
+   </dd>
+
   </dl><div class=impl>
 
   <p>Objects that implement the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code>
@@ -999,6 +1041,44 @@
   interface is created, the <code title=dom-context-2d-miterLimit><a href=#dom-context-2d-miterlimit>miterLimit</a></code> attribute must
   initially have the value <code>10.0</code>.</p>
 
+  <hr><p>Each <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> object has a <dfn id=dash-list>dash
+  list</dfn>, which is either empty or consists of an even number of
+  non-negative numbers. Initially, the <a href=#dash-list>dash list</a> must be
+  empty.</p>
+
+  <p>When the <dfn id=dom-context-2d-setlinedash title=dom-context-2d-setLineDash><code>setLineDash()</code></dfn>
+  method is invoked, it must run the following steps:</p>
+
+  <ol><li><p>Let <var title="">a</var> be a copy of the array provided as
+   the argument.</p></li>
+
+   <li><p>If any value in the array is not finite (e.g. an Infinity or
+   a NaN value), or if any value is negative (less than zero), then
+   abort these steps.</p></li>
+
+   <li><p>If the number of elements in <var title="">a</var> is odd,
+   then let <var title="">a</var> be the concatentation of two copies
+   of <var title="">a</var>.</p></li>
+
+   <li><p>Let the object's <a href=#dash-list>dash list</a> be <var title="">a</var>.</p></li>
+
+  </ol><p>When the <dfn id=dom-context-2d-getlinedash title=dom-context-2d-getLineDash><code>getLineDash()</code></dfn>
+  method is invoked, it must return a newly created array whose values
+  are the values of the object's <a href=#dash-list>dash list</a>, in the same
+  order.</p>
+
+  <p>It is sometimes useful to change the "phase" of the dash pattern,
+  e.g. to achieve a "marching ants" effect. The phase can be set using
+  the <dfn id=dom-context-2d-linedashoffset title=dom-context-2d-lineDashOffset><code>lineDashOffset</code></dfn>
+  attribute. On getting, it must return the current value. On setting,
+  infinite and NaN values must be ignored, leaving the value
+  unchanged; other values must change the current value to the new
+  value.</p>
+
+  <p>When the object implementing the <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code>
+  interface is created, the <code title=dom-context-2d-lineDashOffset><a href=#dom-context-2d-linedashoffset>lineDashOffset</a></code>
+  attribute must initially have the value <code>0.0</code>.</p>
+
   <hr><p>When a user agent is to <dfn id=trace-a-path>trace a <span>path</span></dfn>,
   given an object <var title="">style</var> that implements the
   <code><a href=#canvasdrawingstyles>CanvasDrawingStyles</a></code> interface, it must run the following
@@ -1027,14 +1107,14 @@
    the first point to a join (from the newly added closing line to the
    first line).</p>
 
-   </li><li><p>If the <var title="">styles</var> <span>dash list</span> is
+   </li><li><p>If the <var title="">styles</var> <a href=#dash-list>dash list</a> is
    empty, jump to the step labeled <i>joins</i>.</p></li>
 
    <li><p>Let <var title="">width</var> be the aggregate length of all
    the lines of all the subpaths in <var title="">path</var>, in
    coordinate space units.</p></li>
 
-   <li><p>Let <var title="">offset</var> be the value of the <var title="">styles</var> <code title=dom-context-2d-lineDashOffset>lineDashOffset</code>, in
+   <li><p>Let <var title="">offset</var> be the value of the <var title="">styles</var> <code title=dom-context-2d-lineDashOffset><a href=#dom-context-2d-linedashoffset>lineDashOffset</a></code>, in
    coordinate space units.</p></li>
 
    <li>
@@ -1064,8 +1144,8 @@
    other states being <i>on</i> and <i>zero-on</i>).</p></li>
 
    <li><p><i>Dash On</i>: Let <var title="">segment length</var> be
-   the value of the <var title="">styles</var> <span>dash
-   list</span>'s <var title="">index</var>th entry.</p></li>
+   the value of the <var title="">styles</var> <a href=#dash-list>dash
+   list</a>'s <var title="">index</var>th entry.</p></li>
 
    <li><p>Increment <var title="">position</var> by <var title="">segment length</var>.</p></li>
 
@@ -1077,8 +1157,8 @@
    <li><p>Increment <var title="">index</var> by one.</p></li>
 
    <li><p><i>Dash Off</i>: Let <var title="">segment length</var> be
-   the value of the <var title="">styles</var> <span>dash
-   list</span>'s <var title="">index</var>th entry.</p></li>
+   the value of the <var title="">styles</var> <a href=#dash-list>dash
+   list</a>'s <var title="">index</var>th entry.</p></li>
 
    <li><p>Let <var title="">start</var> be the offset <var title="">position</var> on <var title="">L</var>.</p></li>
 
@@ -1149,7 +1229,7 @@
 
    <li><p>Increment <var title="">index</var> by one. If it is equal
    to the number of entries in the <var title="">styles</var>
-   <span>dash list</span>, then let <var title="">index</var> be
+   <a href=#dash-list>dash list</a>, then let <var title="">index</var> be
    0.</p></li>
 
    <li><p>Return to the step labeled <i>dash on</i>.</p></li>
Received on Tuesday, 25 September 2012 02:14:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 25 September 2012 02:14:48 GMT