Skip to content

Commit

Permalink
Change ImageBitmap construction to use RangeError
Browse files Browse the repository at this point in the history
The createImageBitmap() algorithm should fail step 1 with a RangeError,
not the deprecated "IndexSizeError" DOMException.
  • Loading branch information
grorg authored and domenic committed Sep 21, 2017
1 parent 5a51d3e commit e40797b
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -92439,20 +92439,19 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<ol>

<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
<code>DOMException</code> and abort these steps.</p></li>
<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 <var>image</var> is not <span data-x="img-all">completely available</span>, then
return a promise rejected with an <span>"<code>InvalidStateError</code>"</span>
<code>DOMException</code> and abort these steps.</p></li>
<code>DOMException</code>.</p></li>

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

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

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

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

Expand Down Expand Up @@ -92502,9 +92499,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<ol>

<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
<code>DOMException</code> and abort these steps.</p></li>
<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 <code>video</code> element's <code
data-x="dom-media-networkState">networkState</code> attribute is <code
Expand Down Expand Up @@ -92549,9 +92545,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<ol>

<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
<code>DOMException</code> and abort these steps.</p></li>
<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 <code>canvas</code> element's bitmap has either a horizontal dimension or a
vertical dimension equal to zero, then return a promise rejected with an
Expand Down Expand Up @@ -92587,9 +92582,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<ol>

<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
<code>DOMException</code> and abort these steps.</p></li>
<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>Return a new promise, but continue running these steps
<span>in parallel</span>.</p></li>
Expand Down Expand Up @@ -92634,9 +92628,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<ol>

<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
<code>DOMException</code> and abort these steps.</p></li>
<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, return a promise rejected with
Expand Down Expand Up @@ -92665,9 +92658,8 @@ dictionary <dfn>ImageBitmapOptions</dfn> {

<ol>

<li><p>If either the <var>sw</var> or <var>sh</var> arguments are specified
but zero, return a promise rejected with an <span>"<code>IndexSizeError</code>"</span>
<code>DOMException</code> and abort these steps.</p></li>
<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 <var>image</var>'s <span>[[Detached]]</span> internal slot value is true, return a
promise rejected with an <span>"<code>InvalidStateError</code>"</span>
Expand Down

0 comments on commit e40797b

Please sign in to comment.