Re: [css-font-loading] FontFace objects representing the same set of descriptors

On Sun, Sep 28, 2014 at 11:31 PM, Cameron McCormack <cam@mcc.id.au> wrote:

> In Gecko, we have a cache of objects that represent loadable font faces.
> This means that if you use the same @font-face rule on multiple pages in
> the same origin, then we only download the font resource and create OS font
> objects once.  The cache gets exercised frequently, as it's common to
> navigate to pages on the one site that all use the same style sheets with
> the same @font-face rules.
>
> We've discovered that this means in our Font Loading API implementation,
> that if one page starts loading a FontFace, then this will cause the
> FontFace object in another page to have its status set to loading too, and
> eventually have its loaded property resolved.
>

That sounds like a major privacy problem.
Are you going to fix that?


> This isn't so much of a problem with CSS-connected FontFace objects, since
> the implementation can choose to start loading them whenever it feels like
> it, really.  But it does mean that unconnected FontFace objects can appear
> to start loading without the author explicitly loading them.
>
> This happens for FontFace objects in the same page, too.  For example:
>
>   var f1 = new FontFace("ABC", "url(x)");
>   var f2 = new FontFace("ABC", "url(x)");
>
>   f1.load().then(function() {
>     alert(f2.status);
>   });
>
> will alert "loaded", even though we didn't touch f2 explicitly.
>
> My question is whether a FontFace object that is not in the FontFaceSet to
> start loading like this.
>
>

Received on Monday, 29 September 2014 18:06:52 UTC