Intent to Replace: Font Loading API's ready method with a ready attribute returning a promise

43 views
Skip to first unread message

Kenji Baheux

unread,
Dec 19, 2014, 2:03:16 AM12/19/14
to blink-dev, Kunihiko Sakamoto

Primary eng (and PM) emails

@chromium.org preferred over @google.com


Link to “Intent to Deprecate” thread

https://groups.google.com/a/chromium.org/d/msg/blink-dev/XqKrqbMEsZA/TUFfpd18QdwJ


Summary

Summary

In M40, we've been showing deprecation warnings on calls to document.fonts.ready(). In M41, we would like to make the switch from ready() as a method returning a promise to an attribute returning the same promise.


Motivation

For consistency with the pattern of having ready as an attribute (promise). This pattern started to get traction after we shipped our implementation of CSS font loading.



Usage information from UseCounter

Virtually unused as far as we can see from the UseCounter:

https://www.chromestatus.com/metrics/feature/timeline/popularity/464



Compatibility Risk

Theoretically there is a risk that we break websites relying on ready being a function. However, in practice the use counter for this particular feature of the CSS font loading API indicates that it's still rarely used (if ever).

https://www.chromestatus.com/metrics/feature/timeline/popularity/464


Firefox has recently finished their implementation of the CSS font loading API and I was able to confirm that it follows the latest spec when it comes to ready: https://bugzilla.mozilla.org/show_bug.cgi?id=1028497


Internet Explorer / Safari: N/A



Alternative implementation suggestion for web developers

Since the name didn't change, we can't have a deprecation period where both versions co-exist.


One solution would be to use the following approach:

var fontsReady = document.fonts.ready;
 if (typeof(fontsReady) == "function")
   fontsReady = document.fonts.ready();
 fontsReady.then(...);



Entry on chromestatus.com, crbug.com, or MDN

Deprecation: https://code.google.com/p/chromium/issues/detail?id=425447

Impl: https://code.google.com/p/chromium/issues/detail?id=392077




Kunihiko Sakamoto

unread,
Dec 19, 2014, 2:11:27 AM12/19/14
to Kenji Baheux, blink-dev

Correction:


Primary eng (and PM) emails

Philip Jägenstedt

unread,
Dec 19, 2014, 4:16:21 AM12/19/14
to Kenji Baheux, blink-dev, Kunihiko Sakamoto
LGTM

As expected, it's an attribute in Gecko:
https://github.com/mozilla/gecko-dev/blob/8c4dd6fb24a1d9c4f8f6439fa0fb26887d0b86f8/dom/webidl/FontFaceSet.webidl#L50

Philip
> To unsubscribe from this group and stop receiving emails from it, send an
> email to blink-dev+...@chromium.org.

Philip Rogers

unread,
Dec 19, 2014, 5:13:39 PM12/19/14
to Philip Jägenstedt, Kenji Baheux, blink-dev, Kunihiko Sakamoto
LGTM

Chris Harrelson

unread,
Dec 22, 2014, 1:04:20 PM12/22/14
to Philip Rogers, Philip Jägenstedt, Kenji Baheux, blink-dev, Kunihiko Sakamoto
LGTM
Reply all
Reply to author
Forward
0 new messages