W3C home > Mailing lists > Public > www-style@w3.org > February 2016

Re: [Font Loading] FontFaceSet's Ready Promise

From: Myles C. Maxfield <mmaxfield@apple.com>
Date: Tue, 09 Feb 2016 23:33:35 -0800
Cc: www-style@w3.org
Message-id: <6E989103-1320-4AD4-B7A1-E7B5010C7853@apple.com>
To: Cameron McCormack <cam@mcc.id.au>
The spec text doesn't seem to indicate this.

This is a case where the engine may change an attribute of an object at an arbitrary time. This is undesirable behavior; instead, I'd like to change my proposal to be that the ready attribute should be a method instead.

Thanks,
Myles

> On Feb 5, 2016, at 8:45 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> 
> Hi Myles,
> 
> Myles C. Maxfield:
>> FontFaceSet exposes a "ready" promise attribute, which can therefore
>> only be resolved once. However, fonts may start and end loading at
>> any time. Therefore, this promise will give unintuitive and incorrect
>> information much of the time. Instead, the mechanism used to notify
>> script when all fonts in the set have finished loading should be
>> achieved via sending events.
> 
> That particular Promise object will, but a new Promise object is created
> and exposed through FontFaceSet.ready when a loading starts again (after
> a period of loading being complete).
> 
> At any point, if you write
> 
>  document.fonts.ready.then(…)
> 
> you’ll be guaranteed to have your callback invoked either immediately,
> if there are no loads happening currently, or when the current loads
> complete.  Storing away the document.fonts.ready Promise to call then()
> on at a later point wouldn’t be useful.
> 
> -- 
> Cameron McCormack ≝ http://mcc.id.au/
> 
Received on Wednesday, 10 February 2016 07:34:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:00 UTC