Skip to content

Commit

Permalink
Promises are now defined by IDL
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Aug 31, 2015
1 parent d9cff6e commit 2530b44
Showing 1 changed file with 23 additions and 36 deletions.
59 changes: 23 additions & 36 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3010,11 +3010,6 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<li><dfn><code>MutationObserver</code></dfn> interface and <dfn data-x-href="https://dom.spec.whatwg.org/#mutation-observers">mutation observers</dfn> in general</li>

<!--XXX move promises stuff to JS section-->
<li><dfn>Promise</dfn> interface</li>
<li>The <dfn data-x="concept-resolver">resolver</dfn> concept</li>
<li>The <dfn data-x="concept-resolver-fulfill">fulfill</dfn> and <dfn data-x="concept-resolver-reject">reject</dfn> algorithms</li>

</ul>

<p>The following features are defined in the DOM Events specification: <ref spec=DOMEVENTS></p>
Expand Down Expand Up @@ -92153,8 +92148,8 @@ typedef (<span>HTMLImageElement</span> or

[NoInterfaceObject, Exposed=(Window,Worker)]
interface <dfn>ImageBitmapFactories</dfn> {
<span>Promise</span>&lt;ImageBitmap&gt; <span data-x="dom-createImageBitmap">createImageBitmap</span>(<span>ImageBitmapSource</span> image);
<span>Promise</span>&lt;ImageBitmap&gt; <span data-x="dom-createImageBitmap">createImageBitmap</span>(<span>ImageBitmapSource</span> image, long sx, long sy, long sw, long sh);
Promise&lt;ImageBitmap&gt; <span data-x="dom-createImageBitmap">createImageBitmap</span>(<span>ImageBitmapSource</span> image);
Promise&lt;ImageBitmap&gt; <span data-x="dom-createImageBitmap">createImageBitmap</span>(<span>ImageBitmapSource</span> image, long sx, long sy, long sw, long sh);
};
<span>Window</span> implements <span>ImageBitmapFactories</span>;
<span>WorkerGlobalScope</span> implements <span>ImageBitmapFactories</span>;</pre>
Expand All @@ -92176,8 +92171,8 @@ interface <dfn>ImageBitmapFactories</dfn> {
<p>Takes <var>image</var>, which can be an <code>img</code> element,
<code>video</code>, or <code>canvas</code> element, a <code>Blob</code> object, an
<code>ImageData</code> object, a <code>CanvasRenderingContext2D</code> object, or another
<code>ImageBitmap</code> object, and returns a <code>Promise</code> that is resolved when a
new <code>ImageBitmap</code> is created.</p>
<code>ImageBitmap</code> object, and returns a promise that is resolved when a new
<code>ImageBitmap</code> is created.</p>

<p>If no <code>ImageBitmap</code> object can be constructed, for example because the provided
<var>image</var> data is not actually an image, then the promise is rejected instead.</p>
Expand Down Expand Up @@ -92262,11 +92257,10 @@ interface <dfn>ImageBitmapFactories</dfn> {
supported or is disabled), or, if there is no such image, the first frame of the
animation.</p></li>

<li><p>Return a new <code>Promise</code>, but continue running these steps
<li><p>Return a new promise, but continue running these steps
<span>in parallel</span>.</p></li>

<li><p><span data-x="concept-resolver-fulfill">Resolve</span> the <code>Promise</code> with the new
<code>ImageBitmap</code> object as the value.</p></li>
<li><p>Resolve the promise with the new <code>ImageBitmap</code> object as the value.</p></li>

</ol>

Expand Down Expand Up @@ -92306,11 +92300,10 @@ interface <dfn>ImageBitmapFactories</dfn> {
data-x="concept-video-intrinsic-height">intrinsic height</span> (i.e. after any aspect-ratio
correction has been applied), <span>cropped to the source rectangle</span>.</p>

<li><p>Return a new <code>Promise</code>, but continue running these steps
<li><p>Return a new promise, but continue running these steps
<span>in parallel</span>.</p></li>

<li><p><span data-x="concept-resolver-fulfill">Resolve</span> the <code>Promise</code> with the new
<code>ImageBitmap</code> object as the value.</p></li>
<li><p>Resolve the promise with the new <code>ImageBitmap</code> object as the value.</p></li>

</ol>

Expand Down Expand Up @@ -92341,10 +92334,10 @@ interface <dfn>ImageBitmapFactories</dfn> {
<code>canvas</code> element's bitmap data, <span>cropped to the source
rectangle</span>.</p></li>

<li><p>Return a new <code>Promise</code>, but continue running these steps <span>in parallel</span>.</p></li>
<li><p>Return a new promise, but continue running these steps
<span>in parallel</span>.</p></li>

<li><p><span data-x="concept-resolver-fulfill">Resolve</span> the <code>Promise</code> with the new
<code>ImageBitmap</code> object as the value.</p></li>
<li><p>Resolve the promise with the new <code>ImageBitmap</code> object as the value.</p></li>

</ol>

Expand All @@ -92364,12 +92357,11 @@ interface <dfn>ImageBitmapFactories</dfn> {
data-x="dom-Blob-close">close()</code> method, then return a promise rejected with an <code>InvalidStateError</code>
exception and abort these steps.</p></li>

<li><p>Return a new <code>Promise</code>, but continue running these steps <span>in parallel</span>.</p></li>
<li><p>Return a new promise, but continue running these steps
<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 <span
data-x="concept-resolver-reject">reject</span> the <code>Promise</code>'s associated <span
data-x="concept-resolver">resolver</span>, with null as the value, and abort these
occurs during reading of the object</span>, then reject the promise with null, and abort these
steps.</p></li>

<li><p>Apply the <span data-x="Content-Type sniffing: image">image sniffing rules</span> to
Expand All @@ -92379,9 +92371,7 @@ interface <dfn>ImageBitmapFactories</dfn> {

<li><p>If the image data is not in a supported file format (e.g. it's not actually an image at
all), or if the image data is corrupted in some fatal way such that the image dimensions cannot
be obtained, then <span data-x="concept-resolver-reject">reject</span> the
<code>Promise</code>'s associated <span data-x="concept-resolver">resolver</span>, with null as
the value, and abort these steps.</p></li>
be obtained, then reject the promise with null, and abort these steps.</p></li>

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

Expand All @@ -92392,8 +92382,7 @@ interface <dfn>ImageBitmapFactories</dfn> {
supported or is disabled), or, if there is no such image, the first frame of the
animation.</p></li>

<li><p><span data-x="concept-resolver-fulfill">Resolve</span> the <code>Promise</code> with the new
<code>ImageBitmap</code> object as the value.</p></li>
<li><p>Resolve the promise with the new <code>ImageBitmap</code> object as the value.</p></li>

</ol>

Expand All @@ -92418,10 +92407,10 @@ interface <dfn>ImageBitmapFactories</dfn> {
<li><p>Let the <code>ImageBitmap</code> object's bitmap data be the image data given by the
<code>ImageData</code> object, <span>cropped to the source rectangle</span>.</p></li>

<li><p>Return a new <code>Promise</code>, but continue running these steps <span>in parallel</span>.</p></li>
<li><p>Return a new promise, but continue running these steps
<span>in parallel</span>.</p></li>

<li><p><span data-x="concept-resolver-fulfill">Resolve</span> the <code>Promise</code> with the new
<code>ImageBitmap</code> object as the value.</p></li>
<li><p>Resolve the promise with the new <code>ImageBitmap</code> object as the value.</p></li>

</ol>

Expand Down Expand Up @@ -92452,11 +92441,10 @@ interface <dfn>ImageBitmapFactories</dfn> {
<code>CanvasRenderingContext2D</code> object's <span>scratch bitmap</span>, <span>cropped to
the source rectangle</span>.</p></li>

<li><p>Return a new <code>Promise</code>, but continue running these steps
<li><p>Return a new promise, but continue running these steps
<span>in parallel</span>.</p></li>

<li><p><span data-x="concept-resolver-fulfill">Resolve</span> the <code>Promise</code> with the new
<code>ImageBitmap</code> object as the value.</p></li>
<li><p>Resolve the promise with the new <code>ImageBitmap</code> object as the value.</p></li>

</ol>

Expand All @@ -92477,11 +92465,10 @@ interface <dfn>ImageBitmapFactories</dfn> {
<li><p>Let the <code>ImageBitmap</code> object's bitmap data be a copy of the <var>image</var> argument's bitmap data, <span>cropped to the source
rectangle</span>.</p></li>

<li><p>Return a new <code>Promise</code>, but continue running these steps
<li><p>Return a new promise, but continue running these steps
<span>in parallel</span>.</p></li>

<li><p><span data-x="concept-resolver-fulfill">Resolve</span> the <code>Promise</code> with the new
<code>ImageBitmap</code> object as the value.</p></li>
<li><p>Resolve the promise with the new <code>ImageBitmap</code> object as the value.</p></li>

</ol>

Expand Down

0 comments on commit 2530b44

Please sign in to comment.