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

Re: [css-fonts][css-font-loading] Does font loading affect window.load event?

From: Koji Ishii <kojiishi@gmail.com>
Date: Tue, 30 Jun 2015 15:10:35 +0900
Message-ID: <CAN9ydbWAofKf-Lijz+M91JXA9A2aCbCgC+MeZ38+3BSX1b0JXA@mail.gmail.com>
To: John Daggett <jdaggett@mozilla.com>
Cc: "www-style@w3.org" <www-style@w3.org>, wangxianzhu@chromium.org
Thank you for the prompt answer.

On Tue, Jun 30, 2015 at 1:41 PM, John Daggett <jdaggett@mozilla.com> wrote:

> Koji Ishii wrote:
>
> > We had a discussion whether window.load event should be delayed until
> > all font resources are loaded or not, but I was unable to point to the
> > definition.
> >
> > Is this defined somewhere, or discussed before?
>
> Not quite sure who "we" is here but I guess I'm assuming Google folks?
>

Sorry for the lack of the context. In blink-dev community, there was a
discussion when the test runner should take screenshots for tests that
contain @font-face. I wanted to find the answer in the spec without luck.

Short answer is that this isn't explicitly defined, either in an events
> spec or in a CSS spec. The window.load event is supposed to fire when all
> dependent resources have been loaded but Webkit progency fire relatively
> early, before all fonts are loaded. Firefox fires after all fonts are
> loaded. Dunno what IE does.
>
> This is one reason authors should try to use the font loading API to
> assure that fonts are loaded, rather than relying on browsers to include
> fonts among the resources that must load before the load event fires.
>

That gives very clear answer, thank you. So if we wish our tests to be
interoperable, tests should check the load event along with
document.fonts.ready.

Thank you, that was really helpful!!

/koji
Received on Tuesday, 30 June 2015 06:11:08 UTC

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