зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1028497 - Part 16: Don't destroy the user font set if there are no @font-face rules. r=jfkthame
We can no longer call FontFaceSet::DestroyUserFontSet (what used to be nsUserFontSet::Destroy) in nsPresContext::FlushUserFontSet, since we need to keep tracking FontFace objects even if the list of @font-face rules is empty.
This commit is contained in:
Родитель
e2ac89aaed
Коммит
cf965693b0
|
@ -2109,26 +2109,14 @@ nsPresContext::FlushUserFontSet()
|
|||
if (gfxPlatform::GetPlatform()->DownloadableFontsEnabled()) {
|
||||
nsTArray<nsFontFaceRuleContainer> rules;
|
||||
if (!mShell->StyleSet()->AppendFontFaceRules(this, rules)) {
|
||||
if (mFontFaceSet) {
|
||||
mFontFaceSet->DestroyUserFontSet();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
|
||||
if (rules.Length() == 0) {
|
||||
if (mFontFaceSet) {
|
||||
mFontFaceSet->DestroyUserFontSet();
|
||||
changed = true;
|
||||
}
|
||||
} else {
|
||||
if (!mFontFaceSet) {
|
||||
mFontFaceSet = new FontFaceSet(mDocument->GetInnerWindow(), this);
|
||||
}
|
||||
mFontFaceSet->EnsureUserFontSet(this);
|
||||
changed = mFontFaceSet->UpdateRules(rules);
|
||||
if (!mFontFaceSet) {
|
||||
mFontFaceSet = new FontFaceSet(mDocument->GetInnerWindow(), this);
|
||||
}
|
||||
mFontFaceSet->EnsureUserFontSet(this);
|
||||
bool changed = mFontFaceSet->UpdateRules(rules);
|
||||
|
||||
// We need to enqueue a style change reflow (for later) to
|
||||
// reflect that we're modifying @font-face rules. (However,
|
||||
|
|
Загрузка…
Ссылка в новой задаче