[html5] r6558 - [giow] (2) Define how singular matrices affect canvas fills and strokes.

whatwg at whatwg.org whatwg at whatwg.org
Wed Sep 21 15:13:32 PDT 2011


Author: ianh
Date: 2011-09-21 15:13:30 -0700 (Wed, 21 Sep 2011)
New Revision: 6558

Modified:
   complete.html
   index
   source
Log:
[giow] (2) Define how singular matrices affect canvas fills and strokes.

Modified: complete.html
===================================================================
--- complete.html	2011-09-20 00:11:44 UTC (rev 6557)
+++ complete.html	2011-09-21 22:13:30 UTC (rev 6558)
@@ -239,7 +239,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 20 September 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 21 September 2011</h2>
    </hgroup><dl><dt>Multiple-page version:</dt>
     <dd><a href=http://www.whatwg.org/specs/web-apps/current-work/complete/>http://www.whatwg.org/specs/web-apps/current-work/complete/</a></dd>
     <dt>One-page version:</dt>
@@ -35641,6 +35641,10 @@
   <p>When the context is created, the <code title=dom-context-2d-strokeStyle><a href=#dom-context-2d-strokestyle>strokeStyle</a></code> and <code title=dom-context-2d-fillStyle><a href=#dom-context-2d-fillstyle>fillStyle</a></code> attributes must
   initially have the string value <code title="">#000000</code>.</p>
 
+  <p>When the value is a color, it must not be affected by the
+  transformation matrix when used to draw on the canvas.</p> <!-- so
+  singular matrices don't affect solid color fillStyles -->
+
   </div>
 
   <hr><p>There are two types of gradients, linear gradients and radial
@@ -35781,23 +35785,13 @@
   color of the last offset, and areas outside the cone untouched by
   the gradient (transparent black).</p>
 
-  <p>The points in the radial gradient must be transformed as
+  <p>The resulting radial gradient must then be transformed as
   described by the <a href=#transformations title=dom-context-2d-transformation>current
   transformation matrix</a> when rendering.</p>
 
   <p>Gradients must be painted only where the relevant stroking or
   filling effects requires that they be drawn.</p>
 
-<!--
-  <p>Support for actually painting gradients is optional. Instead of
-  painting the gradients, user agents may instead just paint the first
-  stop's color. However, <code
-  title="dom-context-2d-createLinearGradient">createLinearGradient()</code>
-  and <code
-  title="dom-context-2d-createRadialGradient">createRadialGradient()</code>
-  must always return objects when passed valid arguments.</p>
--->
-
   </div>
 
   <hr><p>Patterns are represented by objects implementing the opaque
@@ -35859,15 +35853,19 @@
 
   <p>Patterns must be painted so that the top left of the first image
   is anchored at the origin of the coordinate space, and images are
-  then repeated horizontally to the left and right (if the
-  <code>repeat-x</code> string was specified) or vertically up and
-  down (if the <code>repeat-y</code> string was specified) or in all
-  four directions all over the canvas (if the <code>repeat</code>
-  string was specified). The images are not scaled by this process;
-  one CSS pixel of the image must be painted on one coordinate space
-  unit. Of course, patterns must actually be painted only where the
-  stroking or filling effect requires that they be drawn, and are
-  affected by the current transformation matrix.</p>
+  then repeated horizontally to the left and right, if the
+  <code>repeat-x</code> string was specified, or vertically up and
+  down, if the <code>repeat-y</code> string was specified, or in all
+  four directions all over the canvas, if the <code>repeat</code>
+  string was specified, to create the repeated pattern that is used
+  for rendering. The images are not scaled by this process; one CSS
+  pixel of the image must be painted on one coordinate space unit in
+  generating the repeated pattern. When rendered, however, patterns
+  must actually be painted only where the stroking or filling effect
+  requires that they be drawn, and the repeated pattern must be
+  affected by the current transformation matrix. Pixels not covered by
+  the repeating pattern (if the <code>repeat</code> string was not
+  specified) must be transparent black.</p>
 
   <p>If the original image data is a bitmap image, the value painted
   at a point in the area of the repetitions is computed by filtering
@@ -35905,8 +35903,19 @@
 
   </div>
 
+  <div class=impl>
 
+  <hr><p>If a radial gradient or repeated pattern is used when the
+  transformation matrix is singular, the resulting style must be
+  transparent black (otherwise the gradient or pattern would be
+  collapsed to a point or line, leaving the other pixels undefined).
+  Linear gradients and solid colors always define all points even with
+  singular tranformation matrices.</p>
 
+  </div>
+
+
+
   <h6 id=line-styles><span class=secno>4.8.11.1.5 </span>Line styles</h6>
 
   <dl class=domintro><dt><var title="">context</var> . <code title=dom-context-2d-lineWidth><a href=#dom-context-2d-linewidth>lineWidth</a></code> [ = <var title="">value</var> ]</dt>

Modified: index
===================================================================
--- index	2011-09-20 00:11:44 UTC (rev 6557)
+++ index	2011-09-21 22:13:30 UTC (rev 6558)
@@ -243,7 +243,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 20 September 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 21 September 2011</h2>
    </hgroup><dl><dt><strong>Web developer edition</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -35508,6 +35508,10 @@
   <p>When the context is created, the <code title=dom-context-2d-strokeStyle><a href=#dom-context-2d-strokestyle>strokeStyle</a></code> and <code title=dom-context-2d-fillStyle><a href=#dom-context-2d-fillstyle>fillStyle</a></code> attributes must
   initially have the string value <code title="">#000000</code>.</p>
 
+  <p>When the value is a color, it must not be affected by the
+  transformation matrix when used to draw on the canvas.</p> <!-- so
+  singular matrices don't affect solid color fillStyles -->
+
   </div>
 
   <hr><p>There are two types of gradients, linear gradients and radial
@@ -35648,23 +35652,13 @@
   color of the last offset, and areas outside the cone untouched by
   the gradient (transparent black).</p>
 
-  <p>The points in the radial gradient must be transformed as
+  <p>The resulting radial gradient must then be transformed as
   described by the <a href=#transformations title=dom-context-2d-transformation>current
   transformation matrix</a> when rendering.</p>
 
   <p>Gradients must be painted only where the relevant stroking or
   filling effects requires that they be drawn.</p>
 
-<!--
-  <p>Support for actually painting gradients is optional. Instead of
-  painting the gradients, user agents may instead just paint the first
-  stop's color. However, <code
-  title="dom-context-2d-createLinearGradient">createLinearGradient()</code>
-  and <code
-  title="dom-context-2d-createRadialGradient">createRadialGradient()</code>
-  must always return objects when passed valid arguments.</p>
--->
-
   </div>
 
   <hr><p>Patterns are represented by objects implementing the opaque
@@ -35726,15 +35720,19 @@
 
   <p>Patterns must be painted so that the top left of the first image
   is anchored at the origin of the coordinate space, and images are
-  then repeated horizontally to the left and right (if the
-  <code>repeat-x</code> string was specified) or vertically up and
-  down (if the <code>repeat-y</code> string was specified) or in all
-  four directions all over the canvas (if the <code>repeat</code>
-  string was specified). The images are not scaled by this process;
-  one CSS pixel of the image must be painted on one coordinate space
-  unit. Of course, patterns must actually be painted only where the
-  stroking or filling effect requires that they be drawn, and are
-  affected by the current transformation matrix.</p>
+  then repeated horizontally to the left and right, if the
+  <code>repeat-x</code> string was specified, or vertically up and
+  down, if the <code>repeat-y</code> string was specified, or in all
+  four directions all over the canvas, if the <code>repeat</code>
+  string was specified, to create the repeated pattern that is used
+  for rendering. The images are not scaled by this process; one CSS
+  pixel of the image must be painted on one coordinate space unit in
+  generating the repeated pattern. When rendered, however, patterns
+  must actually be painted only where the stroking or filling effect
+  requires that they be drawn, and the repeated pattern must be
+  affected by the current transformation matrix. Pixels not covered by
+  the repeating pattern (if the <code>repeat</code> string was not
+  specified) must be transparent black.</p>
 
   <p>If the original image data is a bitmap image, the value painted
   at a point in the area of the repetitions is computed by filtering
@@ -35772,8 +35770,19 @@
 
   </div>
 
+  <div class=impl>
 
+  <hr><p>If a radial gradient or repeated pattern is used when the
+  transformation matrix is singular, the resulting style must be
+  transparent black (otherwise the gradient or pattern would be
+  collapsed to a point or line, leaving the other pixels undefined).
+  Linear gradients and solid colors always define all points even with
+  singular tranformation matrices.</p>
 
+  </div>
+
+
+
   <h6 id=line-styles><span class=secno>4.8.11.1.5 </span>Line styles</h6>
 
   <dl class=domintro><dt><var title="">context</var> . <code title=dom-context-2d-lineWidth><a href=#dom-context-2d-linewidth>lineWidth</a></code> [ = <var title="">value</var> ]</dt>

Modified: source
===================================================================
--- source	2011-09-20 00:11:44 UTC (rev 6557)
+++ source	2011-09-21 22:13:30 UTC (rev 6558)
@@ -39245,6 +39245,10 @@
   title="dom-context-2d-fillStyle">fillStyle</code> attributes must
   initially have the string value <code title="">#000000</code>.</p>
 
+  <p>When the value is a color, it must not be affected by the
+  transformation matrix when used to draw on the canvas.</p> <!-- so
+  singular matrices don't affect solid color fillStyles -->
+
   </div>
 
   <hr>
@@ -39439,23 +39443,13 @@
   color of the last offset, and areas outside the cone untouched by
   the gradient (transparent black).</p>
 
-  <p>The points in the radial gradient must be transformed as
+  <p>The resulting radial gradient must then be transformed as
   described by the <span title="dom-context-2d-transformation">current
   transformation matrix</span> when rendering.</p>
 
   <p>Gradients must be painted only where the relevant stroking or
   filling effects requires that they be drawn.</p>
 
-<!--
-  <p>Support for actually painting gradients is optional. Instead of
-  painting the gradients, user agents may instead just paint the first
-  stop's color. However, <code
-  title="dom-context-2d-createLinearGradient">createLinearGradient()</code>
-  and <code
-  title="dom-context-2d-createRadialGradient">createRadialGradient()</code>
-  must always return objects when passed valid arguments.</p>
--->
-
   </div>
 
   <hr>
@@ -39537,15 +39531,19 @@
 
   <p>Patterns must be painted so that the top left of the first image
   is anchored at the origin of the coordinate space, and images are
-  then repeated horizontally to the left and right (if the
-  <code>repeat-x</code> string was specified) or vertically up and
-  down (if the <code>repeat-y</code> string was specified) or in all
-  four directions all over the canvas (if the <code>repeat</code>
-  string was specified). The images are not scaled by this process;
-  one CSS pixel of the image must be painted on one coordinate space
-  unit. Of course, patterns must actually be painted only where the
-  stroking or filling effect requires that they be drawn, and are
-  affected by the current transformation matrix.</p>
+  then repeated horizontally to the left and right, if the
+  <code>repeat-x</code> string was specified, or vertically up and
+  down, if the <code>repeat-y</code> string was specified, or in all
+  four directions all over the canvas, if the <code>repeat</code>
+  string was specified, to create the repeated pattern that is used
+  for rendering. The images are not scaled by this process; one CSS
+  pixel of the image must be painted on one coordinate space unit in
+  generating the repeated pattern. When rendered, however, patterns
+  must actually be painted only where the stroking or filling effect
+  requires that they be drawn, and the repeated pattern must be
+  affected by the current transformation matrix. Pixels not covered by
+  the repeating pattern (if the <code>repeat</code> string was not
+  specified) must be transparent black.</p>
 
   <p>If the original image data is a bitmap image, the value painted
   at a point in the area of the repetitions is computed by filtering
@@ -39585,8 +39583,21 @@
 
   </div>
 
+  <div class="impl">
 
+  <hr>
 
+  <p>If a radial gradient or repeated pattern is used when the
+  transformation matrix is singular, the resulting style must be
+  transparent black (otherwise the gradient or pattern would be
+  collapsed to a point or line, leaving the other pixels undefined).
+  Linear gradients and solid colors always define all points even with
+  singular tranformation matrices.</p>
+
+  </div>
+
+
+
   <h6>Line styles</h6>
 
   <dl class="domintro">




More information about the Commit-Watchers mailing list