W3C home > Mailing lists > Public > www-style@w3.org > April 2013

Re: [css-font-load-events] Using Futures

From: Anne van Kesteren <annevk@annevk.nl>
Date: Fri, 5 Apr 2013 11:02:57 +0100
Message-ID: <CADnb78j8afCMjdS2vD=hmfN-Rk+SLhxwwGnK01ZUZUZ0khh4bg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>, Alex Russell <slightlyoff@google.com>
On Thu, Apr 4, 2013 at 6:35 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> To address use-case #3, the API has two pieces.  If you care about the
> loading status of individual fonts, look for the relevant Font object
> and call its ready() function to obtain a Future which is resolved
> when the font is done loading, or cancelled when the font load has an
> error.  This replaces the loadstart/load/error events.  The
> loading/loadingDone events are unchanged - they're useful for
> providing UI indicating whether fonts are loading or not, rather than
> a one-off "tell me when fonts are ready", which is what the .ready()
> future is for.

I think we should remove the EventTarget dependency for now and
address this use case at a later point when futures gain a way to get
insight into the progress of the operation they represent the result

Also, given that you are using futures, exposing synchronous state
such as checkFont() does not seem like a good idea. loadFont() should
be sufficient.

Received on Friday, 5 April 2013 10:03:24 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:10 UTC