Re: Last Call for "CSS Font Loading Module Level 3"

On Tue, May 27, 2014 at 1:22 AM, Jonas Sicking <jonas@sicking.cc> wrote:
> I've provided this input through a few channels already, but I don't
> think the user of [SetClass] here is good (and in fact I've been
> arguing that SetClass should be removed from WebIDL).

Yes, there's an issue in the spec already saying that I need to move
off of [SetClass] and do Set-fakery instead, until JS stops being a
jerk and allows actual subclassing.  I wanted to get the LC
publication in before I had the time to make the change, but my intent
is pretty clear. ^_^

> First off you likely don't want to key the list of fonts on the
> FontFace object instance like the spec currently does. What it looks
> like you want here is a simple enumerable list of FontFace objects
> which are currently available to the document.
>
> Second, subclassing the ES6 Set class should mean that the following
> two calls are equivalent:
>
> Set.prototype.add.call(myFontFaceSet, someFontFace);
> myFontFaceSet.add(someFontFace);
>
> However I don't think the former would cause the rendering of the
> document to change in, whereas the latter would.
>
> Hence I would strongly recommend coming up with a different solution
> than using SetClass.

Yes, all of these issues are related to the fact that Set and Map are
currently broken in ES, and cannot be subclassed in any meaningful
way.

> Separately, FontFace.loaded seems to fulfill the same purpose as
> FontFaceSet.ready(). I.e. both indicate that the object is done
> loading/parsing/applying its data. It seems more consistent if they
> had the same name, and if both were either an attribute or both were a
> function.

No, the two do completely different (but related) things.  Why do you
think they're identical?  One fulfills when a *particular* FontFace
object finishes loading, the other repeatedly fulfills whenever the
set of loading fonts goes from non-zero to zero.

~TJ

Received on Tuesday, 27 May 2014 17:42:41 UTC