W3C home > Mailing lists > Public > www-style@w3.org > September 2012

Re: [css3-fonts] FontLoader v2

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 10 Sep 2012 18:25:44 -0700
Message-ID: <CAAWBYDCgPSkPG84yP9x9UfPaJYzBgpOeVv3C0=tN4K0z6FU0RQ@mail.gmail.com>
To: John Daggett <jdaggett@mozilla.com>
Cc: www-style list <www-style@w3.org>, Glenn Adams <glenn@skynav.com>
On Mon, Sep 10, 2012 at 6:17 PM, John Daggett <jdaggett@mozilla.com> wrote:
> Tab Atkins wrote:
>> > Unless we change CSSFontFaceRule to not use CSSStyleDescriptor as
>> > a home for the descriptor set, I would oppose not using the
>> > fontface object above. That is, I don't want to see two
>> > interfaces, both CSSStyleDeclaration and this event object
>> > duplicating all the descriptor IDL attributes on different
>> > interfaces. DRY DRY DRY
>>
>> Theoretical purity falls below author utility.  We shouldn't punish
>> authors by forcing them to write ".fontface.style" just because we
>> spec authors can't get our act together on the IDL side.
>
> I don't see this as theoretical purity but as practicality.  The
> event containing all the descriptors is duping those in the
> CSSFontFaceRule.  Which means the event struct definition will need to
> track the rule definition.  In general it's better not to be defining
> structs that are basically the same thing like this.

That's prioritizing spec authors (we have to make sure we keep them in
sync!) over authors.  Don't do that.  Spec authors are the lowest
constituent on the ladder.  (Well, it's arguable whether spec authors
are above or below theoretical purity.  Anyway, they're both well
below authors.  Don't hurt authors just so you can be lazier.)

> While having "loading" and "doneloading" events makes complete sense
> to me, I'm not as clear about what the use case for per-font load
> events is.  I guess if you're displaying UI for a whole set of fonts
> in a font menu you could incrementally expose them as the fonts load.
> Are there other use cases you had in mind?

According to my coworkers working on various Google products, if the
API doesn't have individual font load events, it's practically useless
to them and they'll continue with their existing practice of just
making an off-screen span with the desired font and spinning a timeout
until its metrics change.  The "loading" and "loadingdone" events are
ones that they consider less useful.  ^_^

> I think if the attributes in the event were limited to those used by
> authors for font selection (i.e. family/weight/stretch/style), I
> wouldn't mind as much, it would feel less like you're duping structs.

Don't forget unicode-range.  At that point, you're only three
descriptors away from just including all of them. :/

~TJ
Received on Tuesday, 11 September 2012 01:26:31 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:00 GMT