Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Unified Diff: Source/core/dom/StyleEngine.cpp

Issue 304083003: Made StyleEngine CSSFontSelectorClient instead of StyleResolver. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleEngine.cpp
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index 4d1a0b46a5f9118dbc190a660ca1dd11fa76466b..e1d8f715c5b96a9e0bd927e324b0da075bae4f39 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -76,6 +76,8 @@ StyleEngine::StyleEngine(Document& document)
// HTMLTemplateElement's document, because those documents have no frame.
, m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nullptr)
{
+ if (m_fontSelector)
+ m_fontSelector->registerForInvalidationCallbacks(this);
}
StyleEngine::~StyleEngine()
@@ -95,8 +97,7 @@ void StyleEngine::detachFromDocument()
if (m_fontSelector) {
m_fontSelector->clearDocument();
- if (m_resolver)
- m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
+ m_fontSelector->unregisterForInvalidationCallbacks(this);
}
// Decrement reference counts for things we could be keeping alive.
@@ -450,11 +451,9 @@ void StyleEngine::createResolver()
// Document::isActive() before calling into code which could get here.
ASSERT(document().frame());
- ASSERT(m_fontSelector);
m_resolver = adoptPtrWillBeNoop(new StyleResolver(*m_document));
appendActiveAuthorStyleSheets();
- m_fontSelector->registerForInvalidationCallbacks(m_resolver.get());
combineCSSFeatureFlags(m_resolver->ensureUpdatedRuleFeatureSet());
}
@@ -462,13 +461,8 @@ void StyleEngine::clearResolver()
{
ASSERT(!document().inStyleRecalc());
ASSERT(isMaster() || !m_resolver);
- ASSERT(m_fontSelector || !m_resolver);
- if (m_resolver) {
+ if (m_resolver)
document().updateStyleInvalidationIfNeeded();
-#if !ENABLE(OILPAN)
- m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
-#endif
- }
m_resolver.clear();
}
@@ -634,6 +628,16 @@ void StyleEngine::removeSheet(StyleSheetContents* contents)
m_sheetToTextCache.remove(contents);
}
+void StyleEngine::fontsNeedUpdate(CSSFontSelector*)
+{
+ if (!document().isActive())
+ return;
+
+ if (m_resolver)
+ m_resolver->invalidateMatchedPropertiesCache();
+ document().setNeedsStyleRecalc(SubtreeStyleChange);
+}
+
void StyleEngine::trace(Visitor* visitor)
{
visitor->trace(m_document);
@@ -645,6 +649,7 @@ void StyleEngine::trace(Visitor* visitor)
visitor->trace(m_fontSelector);
visitor->trace(m_textToSheetCache);
visitor->trace(m_sheetToTextCache);
+ CSSFontSelectorClient::trace(visitor);
}
}
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698