Re: [css-font-loading] what happens when you modify a CSS-connected FontFace?

On Wed, Oct 1, 2014 at 4:52 AM, Cameron McCormack <cam@mcc.id.au> wrote:
> Say I do this:
>
>   <style>
>     @font-face { font-family: test; src: url(x); }
>   </style>
>   <script>
>     var face = [...document.fonts][0];
>     face.load().then(function() {
>       face.style = "italic";
>     });
>   </script>
>
> What happens to face's [[FontStatusPromise]] and its status after setting
> the style descriptor?  The spec doesn't allow for a FontFace to go back to
> loading after it is loaded.

Why would anything in particular happen there?  The only effect that
style can have on loading is helping determine when the UA will
auto-load it. You don't make a different choice of src based on style,
or any of the other attributes.

I was just about to click send on a completely different reply to this
email, because I didn't read it thoroughly and assumed that you were
going to change the @font-face 'src' descriptor, which will indeed
need to be handled specially, as you can't change the source data on a
FontFace object.  I'll need to specify that in that case the FontFace
gets removed and a new one gets added.

~TJ

Received on Wednesday, 1 October 2014 15:48:06 UTC