Skip to content

Commit 29d8343

Browse files
authored
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.
1 parent af11308 commit 29d8343

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

source

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64035,12 +64035,12 @@ v6DVT (also check for '- -' bits in the part above) -->
6403564035
<p>The method, when invoked, must act as follows:</p>
6403664036

6403764037
<ol>
64038+
<li><p>Let <var>buffer</var> be <var>imagedata</var>'s <code
64039+
data-x="dom-imagedata-data">data</code> attribute value's [[ViewedArrayBuffer]] internal
64040+
slot.</p></li>
6403864041

64039-
<li>
64040-
64041-
<p>If <var>imagedata</var>'s <code data-x="dom-imagedata-data">data</code> attribute value's
64042-
<span>[[Detached]]</span> internal slot value is true, then throw an
64043-
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p>
64042+
<li><p>If <span>IsDetachedBuffer</span>(<var>buffer</var>) is true, then throw an
64043+
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
6404464044

6404564045
<li>
6404664046

@@ -92878,11 +92878,11 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9287892878
premultiplied by its alpha channel.
9287992879

9288092880
<p>Rejects the promise with an <span>"<code>InvalidStateError</code>"</span>
92881-
<code>DOMException</code> if the source image is not in a valid state (e.g. an <code>img</code>
92881+
<code>DOMException</code> if the source image is not in a valid state (e.g., an <code>img</code>
9288292882
element that hasn't loaded successfully, an <code>ImageBitmap</code> object whose
9288392883
<span>[[Detached]]</span> internal slot value is true, an <code>ImageData</code> object whose
92884-
<code data-x="dom-imagedata-data">data</code> attribute value's <span>[[Detached]]</span>
92885-
internal slot value is true, or a <code>Blob</code> whose data cannot be interpreted as a bitmap
92884+
<code data-x="dom-imagedata-data">data</code> attribute value's [[ViewedArrayBuffer]] internal
92885+
slot is detached, or a <code>Blob</code> whose data cannot be interpreted as a bitmap
9288692886
image).</p>
9288792887

9288892888
<p>Rejects the promise with a <span>"<code>SecurityError</code>"</span>
@@ -93194,9 +93194,13 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9319493194
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
9319593195
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
9319693196

93197-
<li><p>If the <var>image</var> object's <code data-x="dom-imagedata-data">data</code> attribute
93198-
value's <span>[[Detached]]</span> internal slot value is true, then return a promise rejected
93199-
with an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
93197+
<li><p>Let <var>buffer</var> be <var>image</var>'s <code
93198+
data-x="dom-imagedata-data">data</code> attribute value's [[ViewedArrayBuffer]] internal
93199+
slot.</p></li>
93200+
93201+
<li><p>If <span>IsDetachedBuffer</span>(<var>buffer</var>) is true, then return a promise
93202+
rejected with an <span>"<code>InvalidStateError</code>"</span>
93203+
<code>DOMException</code>.</p></li>
9320093204

9320193205
<li><p>Create a new <code>ImageBitmap</code> object.</p></li>
9320293206

0 commit comments

Comments
 (0)