Skip to content

Commit

Permalink
[giow] (3) Match reality better
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=21337
Affected topics: Canvas

git-svn-id: http://svn.whatwg.org/webapps@7888 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 3, 2013
1 parent 55c08f4 commit 0270a59
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
21 changes: 15 additions & 6 deletions complete.html
Expand Up @@ -37686,6 +37686,9 @@ <h6 id=pixel-manipulation><span class=secno>4.8.11.2.16 </span><dfn>Pixel manipu
dimensions. All the pixels in the returned object are transparent
black.</p>

<p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if the either
of the width or height arguments are zero.</p>

</dd>

<dt><var title="">imagedata</var> = <var title="">context</var> . <code title=dom-context-2d-createImageData><a href=#dom-context-2d-createimagedata>createImageData</a></code>(<var title="">imagedata</var>)</dt>
Expand All @@ -37708,6 +37711,9 @@ <h6 id=pixel-manipulation><span class=secno>4.8.11.2.16 </span><dfn>Pixel manipu
space unit. All the pixels in the returned object are transparent
black.</p>

<p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if the either
of the width or height arguments are zero.</p>

</dd>

<dt><var title="">imagedata</var> = <var title="">context</var> . <code title=dom-context-2d-getImageData><a href=#dom-context-2d-getimagedata>getImageData</a></code>(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</dt>
Expand Down Expand Up @@ -37817,6 +37823,7 @@ <h6 id=pixel-manipulation><span class=secno>4.8.11.2.16 </span><dfn>Pixel manipu
</dd>

</dl><div class=impl>
<!--CLEANUP-->

<p>The <code title=dom-context-2d-createImageData><a href=#dom-context-2d-createimagedata>createImageData()</a></code> and
<code title=dom-context-2d-createImageDataHD><a href=#dom-context-2d-createimagedatahd>createImageDataHD()</a></code>
Expand All @@ -37826,19 +37833,22 @@ <h6 id=pixel-manipulation><span class=secno>4.8.11.2.16 </span><dfn>Pixel manipu
<p>When the <dfn id=dom-context-2d-createimagedata title=dom-context-2d-createImageData><code>createImageData()</code></dfn>
method is invoked with two arguments <var title="">sw</var> and <var title="">sh</var>, it must
return a new <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with a width in equal to the
absolute magnitude of <var title="">sw</var> and a height equal to the absolute magnitude of <var title="">sh</var>, and with a 1.0 pixel density. When invoked with a single <var title="">imagedata</var> argument, it must return a new <code><a href=#imagedata>ImageData</a></code> object representing
absolute magnitude of <var title="">sw</var> and a height equal to the absolute magnitude of <var title="">sh</var>, and with a 1.0 pixel density, if both <var title="">sw</var> and <var title="">sh</var>
are non-zero. If one or both of <var title="">sw</var> and <var title="">sh</var> are zero, then the
method must throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception instead. When invoked with a single <var title="">imagedata</var> argument, it must return a new <code><a href=#imagedata>ImageData</a></code> object representing
a rectangle with the same dimensions and pixel density as the <code><a href=#imagedata>ImageData</a></code> object passed
as the argument. In either case, the <code><a href=#imagedata>ImageData</a></code> object returned must be filled with
as the argument. When the method returns an <code><a href=#imagedata>ImageData</a></code> object, it must be filled with
transparent black.</p>

<p>When the <dfn id=dom-context-2d-createimagedatahd title=dom-context-2d-createImageDataHD><code>createImageDataHD()</code></dfn>
method is invoked (with its two arguments <var title="">sw</var> and <var title="">sh</var>) it
must return a new <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with a width in equal to
method is invoked and both of its arguments (<var title="">sw</var> and <var title="">sh</var>) are non-zero, it
must return a new <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with a width equal to
the absolute magnitude of <var title="">sw</var> multiplied by <var title="">scale</var>, a height
equal to the absolute magnitude of <var title="">sh</var> multiplied by <var title="">scale</var>,
and a pixel density equal to <var title="">scale</var>, where <var title="">scale</var> is the
number of pixels in the <a href=#scratch-bitmap>scratch bitmap</a> per coordinate space units. The
<code><a href=#imagedata>ImageData</a></code> object returned must be filled with transparent black.</p>
<code><a href=#imagedata>ImageData</a></code> object returned must be filled with transparent black. If either or both
of the arguments are zero, the method must instead throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception.</p>

<p>The <dfn id=dom-context-2d-getimagedata title=dom-context-2d-getImageData><code>getImageData(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</code></dfn> method must, if
either the <var title="">sw</var> or <var title="">sh</var> arguments are zero, throw an
Expand All @@ -37847,7 +37857,6 @@ <h6 id=pixel-manipulation><span class=secno>4.8.11.2.16 </span><dfn>Pixel manipu
if the <a href=#scratch-bitmap>scratch bitmap</a>'s <a href=#concept-canvas-origin-clean title=concept-canvas-origin-clean>origin-clean</a>
flag is set to false, it must throw a <code><a href=#securityerror>SecurityError</a></code> exception;
<!--REMOVE-TOPIC:Security-->

otherwise, it must return an <code><a href=#imagedata>ImageData</a></code> object with width <var title="">sw</var> and
height <var title="">sh</var> representing the <a href=#scratch-bitmap>scratch bitmap</a> for the area of that
bitmap denoted by the rectangle whose corners are the four points (<var title="">sx</var>, <var title="">sy</var>), (<span title=""><var title="">sx</var>+<var title="">sw</var></span>, <var title="">sy</var>), (<span title=""><var title="">sx</var>+<var title="">sw</var></span>, <span title=""><var title="">sy</var>+<var title="">sh</var></span>), (<var title="">sx</var>, <span title=""><var title="">sy</var>+<var title="">sh</var></span>), in the bitmap's coordinate space
Expand Down
21 changes: 15 additions & 6 deletions index
Expand Up @@ -37686,6 +37686,9 @@ partial dictionary <a href=#mouseeventinit>MouseEventInit</a> {
dimensions. All the pixels in the returned object are transparent
black.</p>

<p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if the either
of the width or height arguments are zero.</p>

</dd>

<dt><var title="">imagedata</var> = <var title="">context</var> . <code title=dom-context-2d-createImageData><a href=#dom-context-2d-createimagedata>createImageData</a></code>(<var title="">imagedata</var>)</dt>
Expand All @@ -37708,6 +37711,9 @@ partial dictionary <a href=#mouseeventinit>MouseEventInit</a> {
space unit. All the pixels in the returned object are transparent
black.</p>

<p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if the either
of the width or height arguments are zero.</p>

</dd>

<dt><var title="">imagedata</var> = <var title="">context</var> . <code title=dom-context-2d-getImageData><a href=#dom-context-2d-getimagedata>getImageData</a></code>(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</dt>
Expand Down Expand Up @@ -37817,6 +37823,7 @@ partial dictionary <a href=#mouseeventinit>MouseEventInit</a> {
</dd>

</dl><div class=impl>
<!--CLEANUP-->

<p>The <code title=dom-context-2d-createImageData><a href=#dom-context-2d-createimagedata>createImageData()</a></code> and
<code title=dom-context-2d-createImageDataHD><a href=#dom-context-2d-createimagedatahd>createImageDataHD()</a></code>
Expand All @@ -37826,19 +37833,22 @@ partial dictionary <a href=#mouseeventinit>MouseEventInit</a> {
<p>When the <dfn id=dom-context-2d-createimagedata title=dom-context-2d-createImageData><code>createImageData()</code></dfn>
method is invoked with two arguments <var title="">sw</var> and <var title="">sh</var>, it must
return a new <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with a width in equal to the
absolute magnitude of <var title="">sw</var> and a height equal to the absolute magnitude of <var title="">sh</var>, and with a 1.0 pixel density. When invoked with a single <var title="">imagedata</var> argument, it must return a new <code><a href=#imagedata>ImageData</a></code> object representing
absolute magnitude of <var title="">sw</var> and a height equal to the absolute magnitude of <var title="">sh</var>, and with a 1.0 pixel density, if both <var title="">sw</var> and <var title="">sh</var>
are non-zero. If one or both of <var title="">sw</var> and <var title="">sh</var> are zero, then the
method must throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception instead. When invoked with a single <var title="">imagedata</var> argument, it must return a new <code><a href=#imagedata>ImageData</a></code> object representing
a rectangle with the same dimensions and pixel density as the <code><a href=#imagedata>ImageData</a></code> object passed
as the argument. In either case, the <code><a href=#imagedata>ImageData</a></code> object returned must be filled with
as the argument. When the method returns an <code><a href=#imagedata>ImageData</a></code> object, it must be filled with
transparent black.</p>

<p>When the <dfn id=dom-context-2d-createimagedatahd title=dom-context-2d-createImageDataHD><code>createImageDataHD()</code></dfn>
method is invoked (with its two arguments <var title="">sw</var> and <var title="">sh</var>) it
must return a new <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with a width in equal to
method is invoked and both of its arguments (<var title="">sw</var> and <var title="">sh</var>) are non-zero, it
must return a new <code><a href=#imagedata>ImageData</a></code> object representing a rectangle with a width equal to
the absolute magnitude of <var title="">sw</var> multiplied by <var title="">scale</var>, a height
equal to the absolute magnitude of <var title="">sh</var> multiplied by <var title="">scale</var>,
and a pixel density equal to <var title="">scale</var>, where <var title="">scale</var> is the
number of pixels in the <a href=#scratch-bitmap>scratch bitmap</a> per coordinate space units. The
<code><a href=#imagedata>ImageData</a></code> object returned must be filled with transparent black.</p>
<code><a href=#imagedata>ImageData</a></code> object returned must be filled with transparent black. If either or both
of the arguments are zero, the method must instead throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception.</p>

<p>The <dfn id=dom-context-2d-getimagedata title=dom-context-2d-getImageData><code>getImageData(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</code></dfn> method must, if
either the <var title="">sw</var> or <var title="">sh</var> arguments are zero, throw an
Expand All @@ -37847,7 +37857,6 @@ partial dictionary <a href=#mouseeventinit>MouseEventInit</a> {
if the <a href=#scratch-bitmap>scratch bitmap</a>'s <a href=#concept-canvas-origin-clean title=concept-canvas-origin-clean>origin-clean</a>
flag is set to false, it must throw a <code><a href=#securityerror>SecurityError</a></code> exception;
<!--REMOVE-TOPIC:Security-->

otherwise, it must return an <code><a href=#imagedata>ImageData</a></code> object with width <var title="">sw</var> and
height <var title="">sh</var> representing the <a href=#scratch-bitmap>scratch bitmap</a> for the area of that
bitmap denoted by the rectangle whose corners are the four points (<var title="">sx</var>, <var title="">sy</var>), (<span title=""><var title="">sx</var>+<var title="">sw</var></span>, <var title="">sy</var>), (<span title=""><var title="">sx</var>+<var title="">sw</var></span>, <span title=""><var title="">sy</var>+<var title="">sh</var></span>), (<var title="">sx</var>, <span title=""><var title="">sy</var>+<var title="">sh</var></span>), in the bitmap's coordinate space
Expand Down
21 changes: 15 additions & 6 deletions source
Expand Up @@ -41191,6 +41191,9 @@ partial dictionary <span>MouseEventInit</span> {
dimensions. All the pixels in the returned object are transparent
black.</p>

<p>Throws an <code>IndexSizeError</code> exception if the either
of the width or height arguments are zero.</p>

</dd>

<dt><var title="">imagedata</var> = <var title="">context</var> . <code title="dom-context-2d-createImageData">createImageData</code>(<var title="">imagedata</var>)</dt>
Expand All @@ -41213,6 +41216,9 @@ partial dictionary <span>MouseEventInit</span> {
space unit. All the pixels in the returned object are transparent
black.</p>

<p>Throws an <code>IndexSizeError</code> exception if the either
of the width or height arguments are zero.</p>

</dd>

<dt><var title="">imagedata</var> = <var title="">context</var> . <code title="dom-context-2d-getImageData">getImageData</code>(<var title="">sx</var>, <var title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</dt>
Expand Down Expand Up @@ -41327,6 +41333,7 @@ partial dictionary <span>MouseEventInit</span> {
</dl>

<div class="impl">
<!--CLEANUP-->

<p>The <code
title="dom-context-2d-createImageData">createImageData()</code> and
Expand All @@ -41339,20 +41346,23 @@ partial dictionary <span>MouseEventInit</span> {
method is invoked with two arguments <var title="">sw</var> and <var title="">sh</var>, it must
return a new <code>ImageData</code> object representing a rectangle with a width in equal to the
absolute magnitude of <var title="">sw</var> and a height equal to the absolute magnitude of <var
title="">sh</var>, and with a 1.0 pixel density. When invoked with a single <var
title="">sh</var>, and with a 1.0 pixel density, if both <var title="">sw</var> and <var title="">sh</var>
are non-zero. If one or both of <var title="">sw</var> and <var title="">sh</var> are zero, then the
method must throw an <code>IndexSizeError</code> exception instead. When invoked with a single <var
title="">imagedata</var> argument, it must return a new <code>ImageData</code> object representing
a rectangle with the same dimensions and pixel density as the <code>ImageData</code> object passed
as the argument. In either case, the <code>ImageData</code> object returned must be filled with
as the argument. When the method returns an <code>ImageData</code> object, it must be filled with
transparent black.</p>

<p>When the <dfn title="dom-context-2d-createImageDataHD"><code>createImageDataHD()</code></dfn>
method is invoked (with its two arguments <var title="">sw</var> and <var title="">sh</var>) it
must return a new <code>ImageData</code> object representing a rectangle with a width in equal to
method is invoked and both of its arguments (<var title="">sw</var> and <var title="">sh</var>) are non-zero, it
must return a new <code>ImageData</code> object representing a rectangle with a width equal to
the absolute magnitude of <var title="">sw</var> multiplied by <var title="">scale</var>, a height
equal to the absolute magnitude of <var title="">sh</var> multiplied by <var title="">scale</var>,
and a pixel density equal to <var title="">scale</var>, where <var title="">scale</var> is the
number of pixels in the <span>scratch bitmap</span> per coordinate space units. The
<code>ImageData</code> object returned must be filled with transparent black.</p>
<code>ImageData</code> object returned must be filled with transparent black. If either or both
of the arguments are zero, the method must instead throw an <code>IndexSizeError</code> exception.</p>

<p>The <dfn title="dom-context-2d-getImageData"><code>getImageData(<var title="">sx</var>, <var
title="">sy</var>, <var title="">sw</var>, <var title="">sh</var>)</code></dfn> method must, if
Expand All @@ -41362,7 +41372,6 @@ partial dictionary <span>MouseEventInit</span> {
if the <span>scratch bitmap</span>'s <span title="concept-canvas-origin-clean">origin-clean</span>
flag is set to false, it must throw a <code>SecurityError</code> exception;
<!--REMOVE-TOPIC:Security-->

otherwise, it must return an <code>ImageData</code> object with width <var title="">sw</var> and
height <var title="">sh</var> representing the <span>scratch bitmap</span> for the area of that
bitmap denoted by the rectangle whose corners are the four points (<var title="">sx</var>, <var
Expand Down

0 comments on commit 0270a59

Please sign in to comment.