Closed
Bug 1163877
Opened 9 years ago
Closed 9 years ago
allow a FontFace to be inserted into multiple FontFaceSets
Categories
(Core :: DOM: CSS Object Model, defect)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
mozilla44
People
(Reporter: heycam, Assigned: heycam)
References
Details
Attachments
(4 files, 1 obsolete file)
7.52 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
2.05 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
14.49 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
89.12 KB,
patch
|
jtd
:
review+
|
Details | Diff | Splinter Review |
The Font Loading API spec allows for a FontFace to be inserted into multiple FontFaceSets, which we currently disallow by throwing an exception if you try. I'm wondering how difficult it would be to allow the one gfxUserFontEntry to be used in multiple gfxUserFontSets. A gfxUserFontEntry does have a pointer back to its gfxUserFontSet, which it uses for logging, noting use of local() rules, generation incrementing, checking for private browsing mode, and calling the various virtual methods for loading that end up calling into the FontFaceSet. It might be feasible to have a "main" gfxUserFontSet that a gfxUserFontEntry is associated with (the one from the same document whose window the FontFace object was created in) for most of those things, but for things which alter state on a gfxUserFontSet (such as setting mLocalRulesUsed and incrementing the generation) we'd need to go through the list of other gfxUserFontSets we're in to update that state too. Alternatively, we could clone a gfxUserFontEntry as soon as we add its FontFace to a second FontFaceSet. If we're in the process of loading, I guess we could note the cloned gfxUserFontEntry on the nsFontFaceLoader.
Assignee | ||
Comment 1•9 years ago
|
||
(In reply to Cameron McCormack (:heycam) from comment #0) > Alternatively, we could clone a gfxUserFontEntry as soon as we add its > FontFace to a second FontFaceSet. If we're in the process of loading, I > guess we could note the cloned gfxUserFontEntry on the nsFontFaceLoader. Though if we did clone them before loading, any subsequent load one one wouldn't be reflected in the others.
Assignee | ||
Comment 2•9 years ago
|
||
(In reply to Cameron McCormack (:heycam) from comment #0) > It might be feasible to have a "main" gfxUserFontSet that a gfxUserFontEntry > is associated with (the one from the same document whose window the FontFace > object was created in) for most of those things, but for things which alter > state on a gfxUserFontSet (such as setting mLocalRulesUsed and incrementing > the generation) we'd need to go through the list of other gfxUserFontSets > we're in to update that state too. This approach seems to be working. https://treeherder.mozilla.org/#/jobs?repo=try&revision=e534635e6651
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → cam
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8605561 -
Flags: review?(jdaggett)
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8605562 -
Flags: review?(jdaggett)
Assignee | ||
Comment 5•9 years ago
|
||
Attachment #8605563 -
Flags: review?(jdaggett)
Assignee | ||
Comment 6•9 years ago
|
||
Attachment #8605564 -
Flags: review?(jdaggett)
Updated•9 years ago
|
Attachment #8605561 -
Flags: review?(jdaggett) → review+
Updated•9 years ago
|
Attachment #8605562 -
Flags: review?(jdaggett) → review+
Updated•9 years ago
|
Attachment #8605563 -
Flags: review?(jdaggett) → review+
Comment 7•9 years ago
|
||
Comment on attachment 8605564 [details] [diff] [review] Part 4: Tests. Review of attachment 8605564 [details] [diff] [review]: ----------------------------------------------------------------- The new tests seem fine but maintaining the cross links of FontFaceSet's seems a bit brittle to me. I think it would make sense to have a few more tests that test whether (1) rule-connected faces can't be added across FontFaceSet's and (2) that the FontFaceSet arrays are correct after the UpdateRules method runs. For example, adding faces both directly to a FontFaceSet and via additional @font-face rules.
Assignee | ||
Comment 8•9 years ago
|
||
Attachment #8605564 -
Attachment is obsolete: true
Attachment #8605564 -
Flags: review?(jdaggett)
Attachment #8674659 -
Flags: review?(jdaggett)
Assignee | ||
Comment 9•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2b7fe600c7c2
Comment 10•9 years ago
|
||
Comment on attachment 8674659 [details] [diff] [review] Part 4: Tests. (v2) Review of attachment 8674659 [details] [diff] [review]: ----------------------------------------------------------------- Looks good!
Attachment #8674659 -
Flags: review?(jdaggett) → review+
Comment 11•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d415a463b0cd https://hg.mozilla.org/integration/mozilla-inbound/rev/2d2c70f62872 https://hg.mozilla.org/integration/mozilla-inbound/rev/b1ad23cd3aa0 https://hg.mozilla.org/integration/mozilla-inbound/rev/e822c40683a1
Comment 12•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d415a463b0cd https://hg.mozilla.org/mozilla-central/rev/2d2c70f62872 https://hg.mozilla.org/mozilla-central/rev/b1ad23cd3aa0 https://hg.mozilla.org/mozilla-central/rev/e822c40683a1
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•