diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index dbb435cf4bd5..d479f94a7f54 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -775,6 +775,10 @@ nsPresContext::Observe(nsISupports* aSubject, { if (!nsCRT::strcmp(aTopic, "charset")) { UpdateCharSet(aData); + if (mDeviceContext) { + mDeviceContext->FlushFontCache(); + ClearStyleDataAndReflow(); + } return NS_OK; } diff --git a/layout/base/src/nsPresContext.cpp b/layout/base/src/nsPresContext.cpp index dbb435cf4bd5..d479f94a7f54 100644 --- a/layout/base/src/nsPresContext.cpp +++ b/layout/base/src/nsPresContext.cpp @@ -775,6 +775,10 @@ nsPresContext::Observe(nsISupports* aSubject, { if (!nsCRT::strcmp(aTopic, "charset")) { UpdateCharSet(aData); + if (mDeviceContext) { + mDeviceContext->FlushFontCache(); + ClearStyleDataAndReflow(); + } return NS_OK; }