зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1578154 - Ensure all device contexts flush their nsFontCache when the platform font list is reinitialized. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D45432 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
1b886ecee7
Коммит
4118072885
|
@ -400,6 +400,13 @@ nsresult gfxPlatformFontList::InitFontList() {
|
|||
|
||||
gfxPlatform::PurgeSkiaFontCache();
|
||||
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
if (obs) {
|
||||
// Notify any current presContexts that fonts are being updated, so existing
|
||||
// caches will no longer be valid.
|
||||
obs->NotifyObservers(nullptr, "font-info-updated", nullptr);
|
||||
}
|
||||
|
||||
mAliasTable.Clear();
|
||||
mLocalNameTable.Clear();
|
||||
|
||||
|
|
|
@ -131,6 +131,10 @@ bool nsPresContext::IsDOMPaintEventPending() {
|
|||
}
|
||||
|
||||
void nsPresContext::ForceReflowForFontInfoUpdate() {
|
||||
// Flush the device context's font cache, so that we won't risk getting
|
||||
// stale nsFontMetrics objects from it.
|
||||
DeviceContext()->FlushFontCache();
|
||||
|
||||
// We can trigger reflow by pretending a font.* preference has changed;
|
||||
// this is the same mechanism as gfxPlatform::ForceGlobalReflow() uses
|
||||
// if new fonts are installed during the session, for example.
|
||||
|
|
Загрузка…
Ссылка в новой задаче