- From: Cameron McCormack <cam@mcc.id.au>
- Date: Mon, 29 Sep 2014 16:31:14 +1000
- To: "www-style@w3.org" <www-style@w3.org>
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. 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 06:31:46 UTC