mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1188802 - only rebuild local webfont rules when needed. r=heycam
This commit is contained in:
parent
374f21e4e2
commit
ae14fdcda2
@ -784,6 +784,7 @@ gfxUserFontEntry::GetUserFontSets(nsTArray<gfxUserFontSet*>& aResult)
|
||||
gfxUserFontSet::gfxUserFontSet()
|
||||
: mFontFamilies(4),
|
||||
mLocalRulesUsed(false),
|
||||
mRebuildLocalRules(false),
|
||||
mDownloadCount(0),
|
||||
mDownloadSize(0)
|
||||
{
|
||||
@ -958,6 +959,7 @@ void
|
||||
gfxUserFontSet::RebuildLocalRules()
|
||||
{
|
||||
if (mLocalRulesUsed) {
|
||||
mRebuildLocalRules = true;
|
||||
DoRebuildUserFontSet();
|
||||
}
|
||||
}
|
||||
|
@ -526,6 +526,9 @@ protected:
|
||||
// true when local names have been looked up, false otherwise
|
||||
bool mLocalRulesUsed;
|
||||
|
||||
// true when rules using local names need to be redone
|
||||
bool mRebuildLocalRules;
|
||||
|
||||
// performance stats
|
||||
uint32_t mDownloadCount;
|
||||
uint64_t mDownloadSize;
|
||||
|
@ -789,8 +789,11 @@ FontFaceSet::UpdateRules(const nsTArray<nsFontFaceRuleContainer>& aRules)
|
||||
CheckLoadingFinished();
|
||||
}
|
||||
|
||||
// local rules have been rebuilt, so clear the flag
|
||||
// if local rules needed to be rebuilt, they have been rebuilt at this point
|
||||
if (mUserFontSet->mRebuildLocalRules) {
|
||||
mUserFontSet->mLocalRulesUsed = false;
|
||||
mUserFontSet->mRebuildLocalRules = false;
|
||||
}
|
||||
|
||||
if (LOG_ENABLED() && !mRuleFaces.IsEmpty()) {
|
||||
LOG(("userfonts (%p) userfont rules update (%s) rule count: %d",
|
||||
@ -875,7 +878,8 @@ FontFaceSet::InsertRuleFontFace(FontFace* aFontFace, SheetType aSheetType,
|
||||
|
||||
// if local rules were used, don't use the old font entry
|
||||
// for rules containing src local usage
|
||||
if (mUserFontSet->mLocalRulesUsed) {
|
||||
if (mUserFontSet->mLocalRulesUsed &&
|
||||
mUserFontSet->mRebuildLocalRules) {
|
||||
nsCSSValue val;
|
||||
aFontFace->GetDesc(eCSSFontDesc_Src, val);
|
||||
nsCSSUnit unit = val.GetUnit();
|
||||
|
Loading…
Reference in New Issue
Block a user