Skip to content

Commit

Permalink
Fix #864: don't reject createImageBitmap's promise with null
Browse files Browse the repository at this point in the history
As a drive-by fix, be more consistent about suffixing exception names.
  • Loading branch information
domenic authored and annevk committed Mar 23, 2016
1 parent 5dcc1ee commit d09b045
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions source
Expand Up @@ -38240,7 +38240,7 @@ dictionary <dfn>TrackEventInit</dfn> : <span>EventInit</span> {
<code>table</code> element that is neither a <code>caption</code> element nor a
<code>colgroup</code> element, if any, or at the end of the table if there are no such elements.
If the new value is neither null nor a <code>thead</code> element, then a
<code>HierarchyRequestError</code> DOM exception must be thrown instead.</p>
<code>HierarchyRequestError</code> exception must be thrown instead.</p>

<p>The <dfn><code data-x="dom-table-createTHead">createTHead()</code></dfn> method must return the
first <code>thead</code> element child of the <code>table</code> element, if any; otherwise a new
Expand All @@ -38257,7 +38257,7 @@ dictionary <dfn>TrackEventInit</dfn> : <span>EventInit</span> {
null otherwise. On setting, if the new value is null or a <code>tfoot</code> element, the first
<code>tfoot</code> element child of the <code>table</code> element, if any, must be removed, and
the new value, if not null, must be inserted at the end of the table. If the new value is neither
null nor a <code>tfoot</code> element, then a <code>HierarchyRequestError</code> DOM exception
null nor a <code>tfoot</code> element, then a <code>HierarchyRequestError</code> exception
must be thrown instead.</p>

<p>The <dfn><code data-x="dom-table-createTFoot">createTFoot()</code></dfn> method must return the
Expand Down Expand Up @@ -76806,7 +76806,7 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
</li>

<li><p>If <span>IsPlatformObjectSameOrigin</span>(<var>platformObject</var>) is false, then throw
a <code>SecurityError</code>.</p></li>
a <code>SecurityError</code> exception.</p></li>
</ol>


Expand Down Expand Up @@ -78448,7 +78448,7 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span
<li><p>Let <var>host</var> be the result of <span data-x="host parser">parsing</span> the given
value.</p></li>

<li><p>If <var>host</var> is failure, throw a <code>SecurityError</code>.</p></li>
<li><p>If <var>host</var> is failure, throw a <code>SecurityError</code> exception.</p></li>

<li>

Expand Down Expand Up @@ -79106,7 +79106,7 @@ interface <dfn>History</dfn> {
<code>History</code> interface, on getting, must return the number of entries in the
<span>top-level browsing context</span>'s <span>joint session history</span>. If this
<code>History</code> object is associated with a <code>Document</code> that is not
<span>fully active</span>, getting must instead throw a <code>SecurityError</code>.</p>
<span>fully active</span>, getting must instead throw a <code>SecurityError</code> exception.</p>

<p>The actual entries are not accessible from script.</p>

Expand All @@ -79116,12 +79116,12 @@ interface <dfn>History</dfn> {
</span> of the current entry in the <span>session history</span> must be set to the new
value. If this <code>History</code> object is associated with a <code>Document</code> that is
not <span>fully active</span>, both getting and setting must instead throw a
<code>SecurityError</code>.</p>
<code>SecurityError</code> exception.</p>

<p>The <dfn><code data-x="dom-history-state">state</code></dfn> attribute of the
<code>History</code> interface, on getting, must return the last value it was set to by the user
agent. If this <code>History</code> object is associated with a <code>Document</code> that is
not <span>fully active</span>, getting must instead throw a <code>SecurityError</code>.
not <span>fully active</span>, getting must instead throw a <code>SecurityError</code> exception.
Initially, its value must be null.</p>

<p>When the <dfn><code data-x="dom-history-go">go(<var>delta</var>)</code></dfn> method is
Expand All @@ -79130,17 +79130,17 @@ interface <dfn>History</dfn> {
the user agent must <span>traverse the history by a delta</span> whose value is
<var>delta</var>. If this <code>History</code> object is associated with a <code>Document</code>
that is not <span>fully active</span>, invoking must instead throw a
<code>SecurityError</code>.</p>
<code>SecurityError</code> exception.</p>

<p>When the <dfn><code data-x="dom-history-back">back()</code></dfn> method is invoked, the user
agent must <span>traverse the history by a delta</span> &#x2212;1. If this <code>History</code>
object is associated with a <code>Document</code> that is not <span>fully active</span>,
invoking must instead throw a <code>SecurityError</code>.</p>
invoking must instead throw a <code>SecurityError</code> exception.</p>

<p>When the <dfn><code data-x="dom-history-forward">forward()</code></dfn>method is invoked, the
user agent must <span>traverse the history by a delta</span> +1. If this <code>History</code>
object is associated with a <code>Document</code> that is not <span>fully active</span>,
invoking must instead throw a <code>SecurityError</code>.</p>
invoking must instead throw a <code>SecurityError</code> exception.</p>

<!--TOPIC:HTML-->

Expand Down Expand Up @@ -79253,7 +79253,7 @@ interface <dfn>History</dfn> {
<ol>

<li><p>If this <code>History</code> object is associated with a <code>Document</code> that is
not <span>fully active</span>, throw a <code>SecurityError</code>.</p></li>
not <span>fully active</span>, throw a <code>SecurityError</code> exception.</p></li>

<li><p>Let <var>targetRealm</var> be this <code>History</code> object's <span>relevant settings
object</span>'s <span data-x="environment settings object's realm">Realm</span>.</p></li>
Expand Down Expand Up @@ -85134,7 +85134,7 @@ interface <dfn>NavigatorOnLine</dfn> {
<p>If the result is error:</p>

<ol>
<li><p>Let <var>error</var> be a new <code>TypeError</code>.</p></li>
<li><p>Let <var>error</var> be a new <code>TypeError</code> exception.</p></li>

<li><p><span>Report the exception</span> <var>error</var> for <var>module
script</var>.</p></li>
Expand Down Expand Up @@ -90197,12 +90197,13 @@ interface <dfn>ImageBitmapFactories</dfn> {
premultiplied by its alpha channel.

<p>Rejects the promise with an <code>InvalidStateError</code> exception if the source image is
not in a valid state (e.g. an <code>img</code> element that hasn't finished loading, or a
not in a valid state (e.g. an <code>img</code> element that hasn't loaded successfully, or a
<code>CanvasRenderingContext2D</code> object whose bitmap data has zero length along one or
both dimensions, an <code>ImageBitmap</code> object whose [[<span>Detached</span>]] internal
slot value is true, or an <code>ImageData</code> object whose <code
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.</p>
slot value is true, or a <code>Blob</code> whose data cannot be interpreted as a bitmap
image).</p>

<p>Rejects the promise with a
<code>SecurityError</code> exception if the script is not allowed to access the image data of
Expand Down Expand Up @@ -90246,7 +90247,7 @@ interface <dfn>ImageBitmapFactories</dfn> {
true and may be changed to false by the steps of <code
data-x="dom-createImageBitmap">createImageBitmap()</code>.</p>

<p><code>ImageBitMap</code> objects are <span>cloneable objects</span> and <span>transferable
<p><code>ImageBitmap</code> objects are <span>cloneable objects</span> and <span>transferable
objects</span>.</p>

<p>Each <code>ImageBitmap</code> object's [[<span>Clone</span>]] internal method, given
Expand Down Expand Up @@ -90425,8 +90426,8 @@ interface <dfn>ImageBitmapFactories</dfn> {
<span>in parallel</span>.</p></li>

<li><p>Read the <code>Blob</code> object's data. If an <span data-x="file-error-read">error
occurs during reading of the object</span>, then reject the promise with null, and abort these
steps.</p></li>
occurs during reading of the object</span>, then reject the promise with an
<code>InvalidStateError</code> exception, and abort these steps.</p></li>

<li><p>Apply the <span data-x="Content-Type sniffing: image">image sniffing rules</span> to
determine the file format of the image data, with MIME type of the <code>Blob</code> (as given
Expand All @@ -90435,8 +90436,8 @@ interface <dfn>ImageBitmapFactories</dfn> {

<li><p>If the image data is not in a supported bitmap image file format (e.g. it's a vector
graphic or it's not an image at all), or if the image data is corrupted in some fatal way such
that the image dimensions cannot be obtained, then reject the promise with null, and abort
these steps.</p></li>
that the image dimensions cannot be obtained, then reject the promise with an
<code>InvalidStateError</code> exception, and abort these steps.</p></li>

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

Expand Down Expand Up @@ -95174,7 +95175,7 @@ interface <dfn>NavigatorConcurrentHardware</dfn> {

<ol>
<li><p>If this <code>WorkerGlobalScope</code> object's <span data-x="concept-WorkerGlobalScope-type">type</span> is
"<code data-x="">module</code>", throw a <code>TypeError</code> and abort these steps.</p></li>
"<code data-x="">module</code>", throw a <code>TypeError</code> exception and abort these steps.</p></li>

<li><p>Let <var>settings object</var> be the <span>incumbent settings
object</span>.</p></li>
Expand Down

0 comments on commit d09b045

Please sign in to comment.