Skip to content

Commit

Permalink
Correct putImageData() throwing condition
Browse files Browse the repository at this point in the history
ImageData's data does not have an [[Detached]] internal slot.

(This makes it consistent with the description of createImageBitmap().)
  • Loading branch information
annevk committed Jan 26, 2018
1 parent 9249592 commit d720617
Showing 1 changed file with 8 additions and 36 deletions.
44 changes: 8 additions & 36 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -63716,33 +63716,22 @@ v6DVT (also check for '- -' bits in the part above) -->
<h6><dfn>Pixel manipulation</dfn></h6>

<dl class="domintro">

<dt><var>imagedata</var> = new <code subdfn data-x="dom-imagedata">ImageData</code>(<var>sw</var>, <var>sh</var>)</dt>
<dt><var>imagedata</var> = <var>context</var> . <code subdfn data-x="dom-context-2d-createImageData">createImageData</code>(<var>sw</var>, <var>sh</var>)</dt>

<dd>

<p>Returns an <code>ImageData</code> object with the given dimensions. All the pixels in the
returned object are <span>transparent black</span>.</p>

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

</dd>

<dt><var>imagedata</var> = <var>context</var> . <code data-x="dom-context-2d-createImageData">createImageData</code>(<var>imagedata</var>)</dt>

<dd>

<p>Returns an <code>ImageData</code> object with the same dimensions as the argument. All the
pixels in the returned object are <span>transparent black</span>.</p>

</dd>
<dd><p>Returns an <code>ImageData</code> object with the same dimensions as the argument. All the
pixels in the returned object are <span>transparent black</span>.</p></dd>

<dt><var>imagedata</var> = new <code data-x="dom-imagedata">ImageData</code>(<var>data</var>, <var>sw</var> [, <var>sh</var> ] )</dt>

<dd>

<p>Returns an <code>ImageData</code> object using the data provided in the <code
data-x="idl-Uint8ClampedArray">Uint8ClampedArray</code> argument, interpreted using the given
dimensions.</p>
Expand All @@ -63753,44 +63742,28 @@ v6DVT (also check for '- -' bits in the part above) -->

<p>Throws an <span>"<code>IndexSizeError</code>"</span> <code>DOMException</code> if the given
data and dimensions can't be interpreted consistently, or if either dimension is zero.</p>

</dd>

<dt><var>imagedata</var> = <var>context</var> . <code subdfn data-x="dom-context-2d-getImageData">getImageData</code>(<var>sx</var>, <var>sy</var>, <var>sw</var>, <var>sh</var>)</dt>

<dd>

<p>Returns an <code>ImageData</code> object containing the image data for the given rectangle of
the bitmap.</p>

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

</dd>

<dt><var>imagedata</var> . <code subdfn data-x="dom-imagedata-width">width</code></dt>
<dt><var>imagedata</var> . <code subdfn data-x="dom-imagedata-height">height</code></dt>

<dd>

<p>Returns the actual dimensions of the data in the <code>ImageData</code> object, in
pixels.</p>

</dd>
<dd><p>Returns the actual dimensions of the data in the <code>ImageData</code> object, in
pixels.</p></dd>

<dt><var>imagedata</var> . <code subdfn data-x="dom-imagedata-data">data</code></dt>

<dd>

<p>Returns the one-dimensional array containing the data in RGBA order, as integers in the range
0 to 255.</p>

</dd>
<dd><p>Returns the one-dimensional array containing the data in RGBA order, as integers in the
range 0 to 255.</p></dd>

<dt><var>context</var> . <code subdfn data-x="dom-context-2d-putImageData">putImageData</code>(<var>imagedata</var>, <var>dx</var>, <var>dy</var> [, <var>dirtyX</var>, <var>dirtyY</var>, <var>dirtyWidth</var>, <var>dirtyHeight</var> ] )</dt>

<dd>

<p>Paints the data from the given <code>ImageData</code> object onto the bitmap. If a dirty
rectangle is provided, only the pixels from that rectangle are painted.</p>

Expand All @@ -63800,10 +63773,9 @@ v6DVT (also check for '- -' bits in the part above) -->
canvas are replaced wholesale, with no composition, alpha blending, no shadows, etc.</p>

<p>Throws an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code> if the
<var>imagedata</var> object's data's <span>[[Detached]]</span> internal slot value is true.</p>

<var>imagedata</var> object's <code data-x="dom-imagedata-data">data</code> attribute value's
[[ViewedArrayBuffer]] internal slot is detached.</p>
</dd>

</dl>

<div w-nodev>
Expand Down

0 comments on commit d720617

Please sign in to comment.