Commit Graph

10 Commits

Author SHA1 Message Date
Cameron McCormack
563288238a Bug 1028497 - Part 17: Factor out FontFace family-name getting. r=jdaggett 2014-10-02 12:32:08 +10:00
Cameron McCormack
31eedc22b4 Bug 1028497 - Part 15.1: Store user font entries in FontFace objects. r=jdaggett 2014-10-02 12:32:08 +10:00
Cameron McCormack
d42d427d94 Bug 1028497 - Part 15: Store FontFace objects on the FontFaceSet rather than nsCSSFontFaceRules. r=jdaggett,bzbarsky
Here we change FontFaceSet's records array to associate gfxUserFontEntry
pointers with FontFace pointers, rather than with nsCSSFontFaceRule
pointers.  This will make it more uniform to handle both CSS-connected
and unconnected FontFace objects when rebuilding the user font entries
under UpdateRules.
2014-10-02 12:32:07 +10:00
Cameron McCormack
21a470ab25 Bug 1028497 - Part 13: Implement FontFace.load(). r=jdaggett 2014-10-02 12:32:07 +10:00
Cameron McCormack
c82125e2b6 Bug 1028497 - Part 12: Implement FontFace.loaded. r=jdaggett,bzbarsky 2014-10-02 12:32:07 +10:00
Cameron McCormack
b5e3edf931 Bug 1028497 - Part 11: Implement FontFace descriptor setters. r=jdaggett
These set the descriptors, but don't cause anything to update, just
like setting descriptors on an @font-face rule's style declaration
doesn't do anything yet.
2014-10-02 12:32:07 +10:00
Cameron McCormack
a054426121 Bug 1028497 - Part 10: Implement FontFace descriptor getters. r=jdaggett
We add an mDescriptors that will be used to store the descriptor values
of an unconnected FontFace object.  For CSS-connected FontFace objects,
the descriptors are stored in the nsCSSFontFaceRule::mDecl.mDescriptors.
(Both of these use the same type, though, CSSFontFaceDescriptors.)

Ideally we could have the descriptors always stored on the FontFace,
and for the nsCSSFontFaceStyleDecl go and fetch them from the FontFace,
but it turned out to be impossible to ensure that a FontFace could be
created whenever a nsCSSFontFaceStyleDecl was cloned, since it needs
access to the window object to create the FontFace's promise objects!
2014-10-02 12:32:07 +10:00
Cameron McCormack
1449ebdb0a Bug 1028497 - Part 9: Implement FontFace.status. r=jdaggett
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.
2014-10-02 12:32:06 +10:00
Cameron McCormack
3691030343 Bug 1028497 - Part 7: Add ability to create a FontFace for a @font-face rule; store it on the nsCSSFontFaceRule. r=jdaggett,bzbarsky
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.
2014-10-02 12:32:06 +10:00
Cameron McCormack
57b587aadd Bug 1028497 - Part 3: Add skeleton implementations of CSSFontFaceLoadEvent, FontFace, FontFaceSet and FontFaceSource. r=jdaggett 2014-10-02 12:32:05 +10:00