Re: [font-load-events] comments on new promises-based draft

Tab Atkins wrote:

>> 2. side effects of 'new FontFace'
>>    a. adds FontFace the FontFaceSet object?
>>    b. adds a new CSSFontFaceRule when on main/Document thread?
> 
> The spec doesn't define any additional side-effects for "new
> FontFace()", so nothing additional happens.  Would you like an
> explicit note that nothing additional occurs?

Well, the implications are sort of funky I think.  You force authors
to explicitly add it to the font set?

  var f = new FontFace(...);
  document.fonts.add(f);

When will a FontFace object be useful independent of the set of fonts
used to support font matching?  

And what are the semantics of loading for fonts that don't belong to a
FontFaceSet?

  var f = new FontFace(...);
  f.load();

So none of the event handlers of FontFaceSet would fire on the load,
right?  And this load would be outside of the promise fulfilled by
FontFaceSet.ready()?

>> The spec really needs to state more clearly both what happens with
>> a new @font-face rule is created and what happens when a new
>> FontFace object is created.  It implies that the two are linked
>> ("CSS-connected") but the exact association isn't clearly spelled out.
>
> Ooh, you're right.  I handle the case where you add a new stylesheet
> that contains @font-face rules, but not the case where you just add
> a new @font-face to an existing stylesheet.  I'll take care of this.

I think there's an odd pair of dual OM's here and the spec needs to
spell out the details a bit more.  That is, on the one hand you have a
set of @font-face rules in a stylesheet that can be manipulated using
CSSRule-derived objects and on the other hand you have a set of
FontFace objects.  It's not just adding but any form of manipulation
and whether mutations are reflected from one to the other.

  @font-face {
    font-family: Whitney;
    src: url(...);
  }

  fontFaceRule.src = "local(Whitney)," + fontFaceRule.src;

Based on what you've written so far, it seems that you're imagining
that the manipulations above are automagically reflected in the
FontFace object that represents the @font-face rule.  But new FontFace
objects added to document.fonts are *not* automatically reflected in
the CSS OM?

Cheers,

John Daggett

Received on Tuesday, 10 September 2013 01:26:28 UTC