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

[Font Loading] FontFaceSet's Ready Promise

From: Myles C. Maxfield <mmaxfield@apple.com>
Date: Thu, 04 Feb 2016 00:48:50 -0800
Message-id: <BC7B5CD1-0539-4DC2-A37F-A368CBA339C5@apple.com>
To: www-style@w3.org
Hello,
I'm implementing the CSS Font Loading spec in WebKit. During implementation, I have come across this issues in the spec:

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.

Therefore, script would first check the "status" attribute to know if there are currently any active downloads. If there are, it would register an event listener. This event would be fired whenever the number of loading fonts goes from 1 -> 0.

--Myles
Received on Thursday, 4 February 2016 08:49:24 UTC

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