[html5] r1190 - /
whatwg at whatwg.org
whatwg at whatwg.org
Thu Jan 31 21:37:13 PST 2008
Author: ianh
Date: 2008-01-31 21:37:11 -0800 (Thu, 31 Jan 2008)
New Revision: 1190
Modified:
index
source
Log:
[gow] (2) Remove any exceptions that would be raised by negative width or height values for any rectangles in the canvas API. (also, some minor editorial changes.)
Modified: index
===================================================================
--- index 2008-02-01 05:13:15 UTC (rev 1189)
+++ index 2008-02-01 05:37:11 UTC (rev 1190)
@@ -16386,7 +16386,7 @@
the horizontal direction and the <var title="">y</var> argument represents
the scale factor in the vertical direction. The factors are multiples. If
either argument is Infinity the transformation matrix must be marked as
- infinite instead of the method throwing an exception.
+ infinite.
<p>The <dfn id=rotate title=dom-context-2d-rotate><code>rotate(<var
title="">angle</var>)</code></dfn> method must add the rotation
@@ -16402,8 +16402,7 @@
the horizontal direction and the <var title="">y</var> argument represents
the translation distance in the vertical direction. The arguments are in
coordinate space units. If either argument is Infinity the transformation
- matrix must be marked as infinite instead of the method throwing an
- exception.
+ matrix must be marked as infinite.
<p>The <dfn id=transform
title=dom-context-2d-transform><code>transform(<var title="">m11</var>,
@@ -16436,7 +16435,7 @@
</table>
<p>If any of the arguments are Infinity the transformation matrix must be
- marked as infinite instead of the method throwing an exception.
+ marked as infinite.
<p>The <dfn id=settransform
title=dom-context-2d-setTransform><code>setTransform(<var
@@ -16448,7 +16447,7 @@
title="">m12</var>, <var title="">m21</var>, <var title="">m22</var>, <var
title="">dx</var>, <var title="">dy</var>)</code> method with the same
arguments. If any of the arguments are Infinity the transformation matrix
- must be marked as infinite instead of the method throwing an exception.
+ must be marked as infinite.
<h6 id=compositing><span class=secno>3.14.11.1.3. </span>Compositing</h6>
@@ -17117,9 +17116,6 @@
title=dom-context-2d-globalCompositeOperation>global composition
operators</a>.
- <p>Negative values for width and height must cause the implementation to
- raise an <code>INDEX_SIZE_ERR</code> exception.
-
<p>The <dfn id=clearrect
title=dom-context-2d-clearRect><code>clearRect(<var title="">x</var>, <var
title="">y</var>, <var title="">w</var>, <var
@@ -17330,10 +17326,6 @@
with the point (<var title="">x</var>, <var title="">y</var>) as the only
point in the subpath.
- <p>Negative values for <var title="">w</var> and <var title="">h</var> must
- cause the implementation to raise an <code>INDEX_SIZE_ERR</code>
- exception.
-
<p>The <dfn id=fill title=dom-context-2d-fill><code>fill()</code></dfn>
method must fill all the subpaths of the current path, using <code
title=dom-context-2d-fillStyle><a href="#fillstyle">fillStyle</a></code>,
@@ -17449,23 +17441,31 @@
-->
<!-- createPattern() has an equivalent paragraph -->
- <p>If the rectangle given by the <var title="">sx</var>, <var
- title="">sy</var>, <var title="">sw</var>, and <var title="">sh</var>
- arguments is not entirely within the source image, or if one of the <var
- title="">sw</var> or <var title="">sh</var> arguments is negative or zero,
- or if one of the <var title="">dw</var> or <var title="">dh</var>
- arguments is negative, the implementation must raise an
- <code>INDEX_SIZE_ERR</code> exception.
+ <p>The source rectangle is the rectangle whose corners are the four points
+ (<var title="">sx</var>, <var title="">sy</var>), (<span><var
+ title="">sx</var>+<var title="">sw</var></span>, <var title="">sy</var>),
+ (<span><var title="">sx</var>+<var title="">sw</var></span>, <span><var
+ title="">sy</var>+<var title="">sh</var></span>), (<var title="">sx</var>,
+ <span><var title="">sy</var>+<var title="">sh</var></span>).
+ <p>If the source rectangle is not entirely within the source image, or if
+ one of the <var title="">sw</var> or <var title="">sh</var> arguments is
+ zero, the implementation must raise an <code>INDEX_SIZE_ERR</code>
+ exception.
+
+ <p>The destination rectangle is the rectangle whose corners are the four
+ points (<var title="">dx</var>, <var title="">dy</var>), (<span><var
+ title="">dx</var>+<var title="">dw</var></span>, <var title="">dy</var>),
+ (<span><var title="">dx</var>+<var title="">dw</var></span>, <span><var
+ title="">dy</var>+<var title="">dh</var></span>), (<var title="">dx</var>,
+ <span><var title="">dy</var>+<var title="">dh</var></span>).
+
<p>When <code title=dom-context-2d-drawImage><a
href="#drawimage">drawImage()</a></code> is invoked, the region of the
- image specified by the source rectangle (<var title="">sx</var>, <var
- title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>) must be
- painted on the region of the canvas specified by the destination rectangle
- (<var title="">dx</var>, <var title="">dy</var>, <var title="">dw</var>,
- <var title="">dh</var>), after applying the <a href="#transformations0"
- title=dom-context-2d-transformation>current transformation matrix</a> to
- the destination rectangle.
+ image specified by the source rectangle must be painted on the region of
+ the canvas specified by the destination rectangle, after applying the <a
+ href="#transformations0" title=dom-context-2d-transformation>current
+ transformation matrix</a> to the points of the destination rectangle.
<p><img alt="" src="images/drawImage.png"></p>
<!-- no alt="" text
@@ -17503,12 +17503,15 @@
title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var
title="">sh</var>)</code></dfn> method must return an <code><a
href="#imagedata">ImageData</a></code> object representing the underlying
- pixel data for the area of the canvas denoted by the rectangle which has
- its top left corner at the (<var title="">sx</var>, <var
- title="">sy</var>) coordinate, and that has width <var title="">sw</var>
- and height <var title="">sh</var>. Pixels outside the canvas must be
- returned as transparent black. Pixels must be returned as
- non-premultiplied alpha values.
+ pixel data for the area of the canvas denoted by the rectangle whose
+ corners are the four points (<var title="">sx</var>, <var
+ title="">sy</var>), (<span><var title="">sx</var>+<var
+ title="">sw</var></span>, <var title="">sy</var>), (<span><var
+ title="">sx</var>+<var title="">sw</var></span>, <span><var
+ title="">sy</var>+<var title="">sh</var></span>), (<var title="">sx</var>,
+ <span><var title="">sy</var>+<var title="">sh</var></span>). Pixels
+ outside the canvas must be returned as transparent black. Pixels must be
+ returned as non-premultiplied alpha values.
<p><code><a href="#imagedata">ImageData</a></code> objects must be
initialised so that their <dfn id=width2
@@ -17543,15 +17546,13 @@
<p class=note>The width and height (<var title="">w</var> and <var
title="">h</var>) might be different from the <var title="">sw</var> and
<var title="">sh</var> arguments to the function, e.g. if the canvas is
- backed by a high-resolution bitmap.
+ backed by a high-resolution bitmap, or if the <var title="">sw</var> and
+ <var title="">sh</var> arguments are negative.
<p>If the <code title=dom-context-2d-getImageData><a
- href="#getimagedata">getImageData(<var title="">sx</var>, <var
- title="">sy</var>, <var title="">sw</var>, <var
- title="">sh</var>)</a></code> method is called with either the <var
- title="">sw</var> or <var title="">sh</var> arguments set to zero or
- negative values, the method must raise an <code>INDEX_SIZE_ERR</code>
- exception.
+ href="#getimagedata">getImageData()</a></code> method is called with
+ either the <var title="">sw</var> or <var title="">sh</var> arguments set
+ to zero, the method must raise an <code>INDEX_SIZE_ERR</code> exception.
<p>The <dfn id=putimagedata
title=dom-context-2d-putImageData><code>putImageData(<var
Modified: source
===================================================================
--- source 2008-02-01 05:13:15 UTC (rev 1189)
+++ source 2008-02-01 05:37:11 UTC (rev 1190)
@@ -13923,8 +13923,7 @@
the scale factor in the horizontal direction and the <var
title="">y</var> argument represents the scale factor in the
vertical direction. The factors are multiples. If either argument is
- Infinity the transformation matrix must be marked as infinite
- instead of the method throwing an exception.</p>
+ Infinity the transformation matrix must be marked as infinite.</p>
<p>The <dfn title="dom-context-2d-rotate"><code>rotate(<var
title="">angle</var>)</code></dfn> method must add the rotation
@@ -13940,7 +13939,7 @@
title="">y</var> argument represents the translation distance in the
vertical direction. The arguments are in coordinate space units. If
either argument is Infinity the transformation matrix must be marked
- as infinite instead of the method throwing an exception.</p>
+ as infinite.</p>
<p>The <dfn title="dom-context-2d-transform"><code>transform(<var
title="">m11</var>, <var title="">m12</var>, <var
@@ -13967,8 +13966,7 @@
</table>
<p>If any of the arguments are Infinity the transformation matrix
- must be marked as infinite instead of the method throwing an
- exception.</p>
+ must be marked as infinite.</p>
<p>The <dfn
title="dom-context-2d-setTransform"><code>setTransform(<var
@@ -13981,7 +13979,7 @@
title="">m21</var>, <var title="">m22</var>, <var title="">dx</var>,
<var title="">dy</var>)</code> method with the same arguments. If
any of the arguments are Infinity the transformation matrix must be
- marked as infinite instead of the method throwing an exception.</p>
+ marked as infinite.</p>
<h6>Compositing</h6>
@@ -14675,10 +14673,6 @@
title="dom-context-2d-globalCompositeOperation">global composition
operators</span>.</p>
- <p>Negative values for width and height must cause the
- implementation to raise an <code>INDEX_SIZE_ERR</code>
- exception.</p>
-
<p>The <dfn title="dom-context-2d-clearRect"><code>clearRect(<var
title="">x</var>, <var title="">y</var>, <var title="">w</var>, <var
title="">h</var>)</code></dfn> method must clear the pixels in the
@@ -14914,11 +14908,7 @@
a new subpath with the point (<var title="">x</var>, <var
title="">y</var>) as the only point in the subpath.</p>
- <p>Negative values for <var title="">w</var> and <var
- title="">h</var> must cause the implementation to raise an
- <code>INDEX_SIZE_ERR</code> exception.</p>
-
<p>The <dfn title="dom-context-2d-fill"><code>fill()</code></dfn>
method must fill all the subpaths of the current path, using
<code title="dom-context-2d-fillStyle">fillStyle</code>, and using
@@ -15041,24 +15031,33 @@
-->
<!-- createPattern() has an equivalent paragraph -->
- <p>If the rectangle given by the <var title="">sx</var>, <var
- title="">sy</var>, <var title="">sw</var>, and <var
- title="">sh</var> arguments is not entirely within the source image,
+ <p>The source rectangle is the rectangle whose corners are the four
+ points (<var title="">sx</var>, <var title="">sy</var>), (<span><var
+ title="">sx</var>+<var title="">sw</var></span>, <var
+ title="">sy</var>), (<span><var title="">sx</var>+<var
+ title="">sw</var></span>, <span><var title="">sy</var>+<var
+ title="">sh</var></span>), (<var title="">sx</var>, <span><var
+ title="">sy</var>+<var title="">sh</var></span>).</p>
+
+ <p>If the source rectangle is not entirely within the source image,
or if one of the <var title="">sw</var> or <var title="">sh</var>
- arguments is negative or zero, or if one of the <var
- title="">dw</var> or <var title="">dh</var> arguments is negative,
- the implementation must raise an <code>INDEX_SIZE_ERR</code>
- exception.</p>
+ arguments is zero, the implementation must raise an
+ <code>INDEX_SIZE_ERR</code> exception.</p>
+ <p>The destination rectangle is the rectangle whose corners are the
+ four points (<var title="">dx</var>, <var title="">dy</var>),
+ (<span><var title="">dx</var>+<var title="">dw</var></span>, <var
+ title="">dy</var>), (<span><var title="">dx</var>+<var
+ title="">dw</var></span>, <span><var title="">dy</var>+<var
+ title="">dh</var></span>), (<var title="">dx</var>, <span><var
+ title="">dy</var>+<var title="">dh</var></span>).</p>
+
<p>When <code title="dom-context-2d-drawImage">drawImage()</code> is
invoked, the region of the image specified by the source rectangle
- (<var title="">sx</var>, <var title="">sy</var>, <var
- title="">sw</var>, <var title="">sh</var>) must be painted on the
- region of the canvas specified by the destination rectangle (<var
- title="">dx</var>, <var title="">dy</var>, <var title="">dw</var>,
- <var title="">dh</var>), after applying the <span
+ must be painted on the region of the canvas specified by the
+ destination rectangle, after applying the <span
title="dom-context-2d-transformation">current transformation
- matrix</span> to the destination rectangle.</p>
+ matrix</span> to the points of the destination rectangle.</p>
<p><img src="images/drawImage.png" alt=""></p> <!-- no alt="" text
since the image is just repeating what was stated in the previous
@@ -15096,12 +15095,16 @@
title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>,
<var title="">sh</var>)</code></dfn> method must return an
<code>ImageData</code> object representing the underlying pixel data
- for the area of the canvas denoted by the rectangle which has its
- top left corner at the (<var title="">sx</var>, <var
- title="">sy</var>) coordinate, and that has width <var
- title="">sw</var> and height <var title="">sh</var>. Pixels outside
- the canvas must be returned as transparent black. Pixels must be
- returned as non-premultiplied alpha values.</p>
+ for the area of the canvas denoted by the rectangle whose corners
+ are the four points (<var title="">sx</var>, <var
+ title="">sy</var>), (<span><var title="">sx</var>+<var
+ title="">sw</var></span>, <var title="">sy</var>), (<span><var
+ title="">sx</var>+<var title="">sw</var></span>, <span><var
+ title="">sy</var>+<var title="">sh</var></span>), (<var
+ title="">sx</var>, <span><var title="">sy</var>+<var
+ title="">sh</var></span>). Pixels outside the canvas must be
+ returned as transparent black. Pixels must be returned as
+ non-premultiplied alpha values.</p>
<p><code>ImageData</code> objects must be initialised so that their
<dfn title="dom-imagedata-width"><code>width</code></dfn> attribute
@@ -15136,14 +15139,14 @@
<p class="note">The width and height (<var title="">w</var> and <var
title="">h</var>) might be different from the <var title="">sw</var>
and <var title="">sh</var> arguments to the function, e.g. if the
- canvas is backed by a high-resolution bitmap.</p>
+ canvas is backed by a high-resolution bitmap, or if the <var
+ title="">sw</var> and <var title="">sh</var> arguments are
+ negative.</p>
<p>If the <code
- title="dom-context-2d-getImageData">getImageData(<var
- title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>,
- <var title="">sh</var>)</code> method is called with either the <var
- title="">sw</var> or <var title="">sh</var> arguments set to zero or
- negative values, the method must raise an
+ title="dom-context-2d-getImageData">getImageData()</code> method is
+ called with either the <var title="">sw</var> or <var
+ title="">sh</var> arguments set to zero, the method must raise an
<code>INDEX_SIZE_ERR</code> exception.</p>
<p>The <dfn
More information about the Commit-Watchers
mailing list