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

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