Index: Source/core/dom/StyleEngine.cpp |
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp |
index 00005d3dd5f769912967767194a2197a9715be18..aead23d3346f4372007426943f6815447a5e7f70 100644 |
--- a/Source/core/dom/StyleEngine.cpp |
+++ b/Source/core/dom/StyleEngine.cpp |
@@ -529,24 +529,23 @@ StyleResolverChange StyleEngine::resolverChanged(RecalcStyleTime time, StyleReso |
void StyleEngine::resetFontSelector() |
dglazkov
2014/01/23 19:15:06
Add a fixme to rename the method?
tasak
2014/01/28 07:16:57
I renamed the method. Now it is clearFontCache().
|
{ |
+ // We should not recreate FontSelector. Instead, clear fontFaceCache. |
+ if (m_fontSelector) |
+ m_fontSelector->fontFaceCache()->clear(); |
+ if (m_resolver) |
+ m_resolver->invalidateMatchedPropertiesCache(); |
+} |
+ |
+void StyleEngine::removeFontFaceRules(const Vector<const StyleRuleFontFace*>& fontFaceRules) |
+{ |
if (!m_fontSelector) |
return; |
- m_fontSelector->clearDocument(); |
- if (m_resolver) { |
- m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get()); |
+ CSSSegmentedFontFaceCache* cache = m_fontSelector->fontFaceCache(); |
+ for (unsigned i = 0; i < fontFaceRules.size(); ++i) |
+ cache->remove(fontFaceRules[i]); |
+ if (m_resolver) |
m_resolver->invalidateMatchedPropertiesCache(); |
- } |
- |
- // If the document has been already detached, we don't need to recreate |
- // CSSFontSelector. |
- if (m_document.isActive()) { |
- m_fontSelector = CSSFontSelector::create(&m_document); |
- if (m_resolver) |
- m_fontSelector->registerForInvalidationCallbacks(m_resolver.get()); |
- } else { |
- m_fontSelector = 0; |
- } |
} |
void StyleEngine::markTreeScopeDirty(TreeScope& scope) |