W3C home > Mailing lists > Public > www-style@w3.org > October 2015

Re: [css-fonts] ready attribute vs function

From: Rik Cabanier <cabanier@gmail.com>
Date: Mon, 5 Oct 2015 21:47:22 -0700
Message-ID: <CAGN7qDC-LvGLoim6L9zgjOtNfG9tq=gR8MWfk=LVtBY57GmqjQ@mail.gmail.com>
To: John Daggett <jdaggett@mozilla.com>
Cc: www-style list <www-style@w3.org>
On Sun, Oct 4, 2015 at 7:15 PM, John Daggett <jdaggett@mozilla.com> wrote:

> Rik Cabanier wrote:
>
> > The CSS font loading spec defines 'ready' as a function [1] returning
> > a promise but in Chrome it's implemented as a read only attribute.
> >
> > Is the spec out of date or did chrome implement it incorrectly?
> >
> > 1: http://www.w3.org/TR/css-font-loading-3/#dom-fontfaceset-ready
>
> Old spec, both Firefox and Chrome implement it an attribute as defined in
> the latest editor's draft:
>
> https://drafts.csswg.org/css-font-loading/#font-face-set-ready
>

Thanks John! I mistakenly clicked on "latest version" and not "editor's
draft".

I've experimented a bit with this API on Chrome. Although it helpfully
tells me when fonts are loaded, it actually fulfills the promise before the
fonts are applied.
So, if I look at the page during the 'ready' phase, the font is still not
there. I can work around it by doing a 'requestAnimationFrame' but it seems
like the callback should happen after content that uses the fonts is laid
out. Thoughts?
Received on Tuesday, 6 October 2015 04:47:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:57 UTC