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

Re: [css-font-loading] FontFaceSet constructor

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 30 Jun 2014 14:57:14 -0700
Message-ID: <CAAWBYDDKb08_m2QPzLGnhU5v5GrRDQVEb+_Pej1HruZJ4v4_JA@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: "www-style@w3.org" <www-style@w3.org>
On Sun, Jun 29, 2014 at 7:52 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> What's the use case for being able to construct a FontFaceSet that is not
> associated with the document?

I know of at least two.

One, if it's intended to be immediately sent to a worker, and not used
on the page.  (Avoiding associating it with the document prevents the
style engine from having to check if the new font is higher in the
font-family list for anything on the page.)

Two, it lets people set up separate sets of low-priority fonts to load
in the background, only adding to the main document when they're fully
loaded.  Associating them with the document immediately means they'll
interact in possibly confusing or annoying ways with the events and
ready promise.  (This one was explicitly brought up to me by an author
on Twitter.)

~TJ
Received on Monday, 30 June 2014 21:58:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC