Skip to content

Commit e40797b

Browse files
grorgdomenic
authored andcommitted
Change ImageBitmap construction to use RangeError
The createImageBitmap() algorithm should fail step 1 with a RangeError, not the deprecated "IndexSizeError" DOMException.
1 parent 5a51d3e commit e40797b

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

source

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92439,20 +92439,19 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9243992439

9244092440
<ol>
9244192441

92442-
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
92443-
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
92444-
<code>DOMException</code> and abort these steps.</p></li>
92442+
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
92443+
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
9244592444

9244692445
<li><p>If <var>image</var> is not <span data-x="img-all">completely available</span>, then
9244792446
return a promise rejected with an <span>"<code>InvalidStateError</code>"</span>
92448-
<code>DOMException</code> and abort these steps.</p></li>
92447+
<code>DOMException</code>.</p></li>
9244992448

9245092449
<li><p>If <var>image</var>'s media data has no <span>intrinsic dimensions</span> (e.g. it's a
9245192450
vector graphic with no specified content size), and both or either of the <dfn><code
9245292451
data-x="dom-ImageBitmapOptions-resizeWidth">resizeWidth</code></dfn> and <dfn><code
9245392452
data-x="dom-ImageBitmapOptions-resizeHeight">resizeHeight</code></dfn> options are not specified,
9245492453
then return a promise rejected with an <span>"<code>InvalidStateError</code>"</span>
92455-
<code>DOMException</code> and abort these steps.</p></li>
92454+
<code>DOMException</code>.</p></li>
9245692455

9245792456
<li><p>If <var>image</var>'s media data has no <span>intrinsic dimensions</span> (e.g. it's a vector
9245892457
graphics with no specified content size), it should be rendered to a bitmap of the size
@@ -92462,13 +92461,11 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9246292461
<li><p>If the <var>sw</var> and <var>sh</var> arguments are not specified and
9246392462
<var>image</var>'s media data has both or either of its <span>intrinsic width</span> and
9246492463
<span>intrinsic height</span> values equal to 0, then return a promise rejected with an
92465-
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code> and abort these
92466-
steps.</p></li>
92464+
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
9246792465

9246892466
<li><p>If the <var>sh</var> argument is not specified and <var>image</var>'s media data has
9246992467
an <span>intrinsic height</span> of 0, then return a promise rejected with an
92470-
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code> and abort these
92471-
steps.</p></li>
92468+
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
9247292469

9247392470
<li><p>Create a new <code>ImageBitmap</code> object.</p></li>
9247492471

@@ -92502,9 +92499,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9250292499

9250392500
<ol>
9250492501

92505-
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
92506-
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
92507-
<code>DOMException</code> and abort these steps.</p></li>
92502+
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
92503+
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
9250892504

9250992505
<li><p>If the <code>video</code> element's <code
9251092506
data-x="dom-media-networkState">networkState</code> attribute is <code
@@ -92549,9 +92545,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9254992545

9255092546
<ol>
9255192547

92552-
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
92553-
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
92554-
<code>DOMException</code> and abort these steps.</p></li>
92548+
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
92549+
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
9255592550

9255692551
<li><p>If the <code>canvas</code> element's bitmap has either a horizontal dimension or a
9255792552
vertical dimension equal to zero, then return a promise rejected with an
@@ -92587,9 +92582,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9258792582

9258892583
<ol>
9258992584

92590-
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
92591-
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
92592-
<code>DOMException</code> and abort these steps.</p></li>
92585+
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
92586+
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
9259392587

9259492588
<li><p>Return a new promise, but continue running these steps
9259592589
<span>in parallel</span>.</p></li>
@@ -92634,9 +92628,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9263492628

9263592629
<ol>
9263692630

92637-
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
92638-
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
92639-
<code>DOMException</code> and abort these steps.</p></li>
92631+
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
92632+
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
9264092633

9264192634
<li><p>If the <var>image</var> object's <code data-x="dom-imagedata-data">data</code> attribute
9264292635
value's <span>[[Detached]]</span> internal slot value is true, return a promise rejected with
@@ -92665,9 +92658,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
9266592658

9266692659
<ol>
9266792660

92668-
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
92669-
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
92670-
<code>DOMException</code> and abort these steps.</p></li>
92661+
<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified but zero, return a
92662+
promise rejected with a <code data-x="js-RangeError">RangeError</code>.</p></li>
9267192663

9267292664
<li><p>If <var>image</var>'s <span>[[Detached]]</span> internal slot value is true, return a
9267392665
promise rejected with an <span>"<code>InvalidStateError</code>"</span>

0 commit comments

Comments
 (0)