W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2013

Re: [whatwg] Proposal: createImageBitmap should return a "Promise" instead of using a callback

From: Anne van Kesteren <annevk@annevk.nl>
Date: Thu, 20 Jun 2013 11:18:07 +0900
Message-ID: <CADnb78j33GzopR_h70dW+fDQ-o8ainWbgjnd8FQ2aaypw0m6qg@mail.gmail.com>
To: Justin Novosad <junov@google.com>
Cc: WHATWG <whatwg@whatwg.org>
On Wed, Jun 19, 2013 at 10:19 PM, Justin Novosad <junov@google.com> wrote:
> The proposal is to change the ImageBitmapFactories IDL to something like
> this:
>
> [NoInterfaceObject]
> interface ImageBitmapFactories {
>   Promise createImageBitmap(ImageBitmapSource image, optional long sx, long
> sy, long sw, long sh);
> };
>
> The value of the promise would resolve to an ImageBitmap object.
>
> What do we think?

I think something like

interface ImageBitmap {
  static Promise create(ImageBitmapSource image, optional long sx,
long sy, long sw, long sh);
};

would be much nicer.


--
http://annevankesteren.nl/
Received on Thursday, 20 June 2013 02:18:32 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:22 UTC