W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2013

Re: [promise] writing detailed spec of ProgressPromise & implementing it

From: Anne van Kesteren <annevk@annevk.nl>
Date: Thu, 8 Aug 2013 14:11:09 +0100
Message-ID: <CADnb78jGzqJ26pxVANBaeaHoT3Lz5BdgGOp5syQqXLg2Gn4GYg@mail.gmail.com>
To: Yusuke Suzuki <yusukesuzuki@chromium.org>
Cc: "www-dom@w3.org" <www-dom@w3.org>
On Thu, Aug 8, 2013 at 9:15 AM, Yusuke Suzuki <yusukesuzuki@chromium.org> wrote:
> We're planning to make ProgressPromise spec more detailed and implement it
> on Blink experimentally.
> ProgressPromise is planed to be used for some APIs, such as XMLHttpRequest /
> FileAPI.
>
> Please feel free to comment about this.

Mozilla has similar plans. Mostly for an <input type=file>-based
directory picker:
http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Aug/0019.html

I'm planning on drafting something in http://dom.spec.whatwg.org/
based on https://github.com/slightlyoff/Promises/blob/master/ProgressFuture.idl

interface ProgressPromiseResolver : PromiseResolver {
  void progress(optional any progressValue);
};

callback ProgressPromiseInit = void (ProgressPromiseResolver
resolver); // maybe reuse PromiseInit

[Constructor(ProgressPromiseInit init)]
interface ProgressPromise : Promise {
  // Returns the context object
  ProgressPromise progress(optional AnyCallback progressHandler);
};

The then()/catch() methods on all Promise objects would still return
an instance of Promise (not any subclass). Progress values would not
forward.

Does that match what you have in mind?


-- 
http://annevankesteren.nl/
Received on Thursday, 8 August 2013 13:11:36 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:03 UTC