Permalink
Browse files

Uint8ClampedArray does not have a [[Detached]] internal slot

Instead of checking a [[Detached]] internal slot, we should instead be using IsDetachedBuffer() on the [[ViewedArrayBuffer]] internal slot of ImageData's data.

Fixes #3343.
  • Loading branch information...
annevk committed Jan 12, 2018
1 parent af11308 commit 29d83435dac041e56f0f4d7076edfd6f2afadd4b
Showing with 15 additions and 11 deletions.
  1. +15 −11 source
View
26 source
@@ -64035,12 +64035,12 @@ v6DVT (also check for '- -' bits in the part above) -->
<p>The method, when invoked, must act as follows:</p>
<ol>
<li><p>Let <var>buffer</var> be <var>imagedata</var>'s <code
data-x="dom-imagedata-data">data</code> attribute value's [[ViewedArrayBuffer]] internal
slot.</p></li>
<li>
<p>If <var>imagedata</var>'s <code data-x="dom-imagedata-data">data</code> attribute value's
<span>[[Detached]]</span> internal slot value is true, then throw an
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p>
<li><p>If <span>IsDetachedBuffer</span>(<var>buffer</var>) is true, then throw an
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
<li>
@@ -92878,11 +92878,11 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
premultiplied by its alpha channel.
<p>Rejects the promise with an <span>"<code>InvalidStateError</code>"</span>
<code>DOMException</code> if the source image is not in a valid state (e.g. an <code>img</code>
<code>DOMException</code> if the source image is not in a valid state (e.g., an <code>img</code>
element that hasn't loaded successfully, an <code>ImageBitmap</code> object whose
<span>[[Detached]]</span> internal slot value is true, an <code>ImageData</code> object whose
<code data-x="dom-imagedata-data">data</code> attribute value's <span>[[Detached]]</span>
internal slot value is true, or a <code>Blob</code> whose data cannot be interpreted as a bitmap
<code data-x="dom-imagedata-data">data</code> attribute value's [[ViewedArrayBuffer]] internal
slot is detached, or a <code>Blob</code> whose data cannot be interpreted as a bitmap
image).</p>
<p>Rejects the promise with a <span>"<code>SecurityError</code>"</span>
@@ -93194,9 +93194,13 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
<li><p>If the <var>image</var> object's <code data-x="dom-imagedata-data">data</code> attribute
value's <span>[[Detached]]</span> internal slot value is true, then return a promise rejected
with an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
<li><p>Let <var>buffer</var> be <var>image</var>'s <code
data-x="dom-imagedata-data">data</code> attribute value's [[ViewedArrayBuffer]] internal
slot.</p></li>
<li><p>If <span>IsDetachedBuffer</span>(<var>buffer</var>) is true, then return a promise
rejected with an <span>"<code>InvalidStateError</code>"</span>
<code>DOMException</code>.</p></li>
<li><p>Create a new <code>ImageBitmap</code> object.</p></li>

0 comments on commit 29d8343

Please sign in to comment.