mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
31eedc22b4
commit
e561bc26bf
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user