We make gfxUserFontEntry::SetLoadState virtual so that we can hook into
changes and update FontFace::mStatus. We can't just reflect the
gfxUserFontEntry's value in FontFace::Status() since the spec has
requirements about when exactly the status is set.
Every nsCSSFontFaceRule that is used will get a FontFace object to
reflect it in the FontFaceSet. Here we add storage on the
nsCSSFontFaceRule for its FontFace, although it will be the
FontFaceSet's responsibility to set it. We also add a static
constructor function on FontFace to create one that reflects a rule.
We can't make FontFace inherit from gfxUserFontEntry, since the former
is cycle collected. So instead, we have a small class that inherits
from it that will override its virtual methods and forward things on to
the FontFace object.
We make gfxUserFontSet::CreateFontFace virtual so we can override it to
produce instances of our gfxUserFontEntry subclass.
This (a) moves ownership of the gfxUserFontSet into FontFaceSet, (b) moves
nearly all of the functionality of nsUserFontSet into FontFaceSet, and (c)
adds a class that inherits from gfxUserFontSet so that we can override some
of its virtual functions and delegate them to the FontFaceSet.