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

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

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: modify Document::styleResolver Created 7 years, 1 month 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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index a9f5313e46dd9327c41c245a8535b97d43bf4e7e..9e9c90e2e6aba0cb6c9f76e1781bfc17f098528b 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -1751,7 +1751,7 @@ void Document::recalcStyle(StyleRecalcChange change)
if (m_styleResolver) {
// Pseudo element removal and similar may only work with these flags still set. Reset them after the style recalc.
- m_styleEngine->resetCSSFeatureFlags(m_styleResolver->ruleFeatureSet());
+ m_styleEngine->resetCSSFeatureFlags(m_styleResolver->ensureRuleFeatureSet());
m_styleResolver->clearStyleSharingList();
}
}
@@ -1960,6 +1960,17 @@ void Document::setIsViewSource(bool isViewSource)
didUpdateSecurityOrigin();
}
+StyleResolver* Document::styleResolver()
esprehn 2013/11/15 10:36:32 We might need to make this inline later, but this
tasak 2013/11/18 08:30:53 I made this inline.
+{
+ if (!m_styleResolver) {
+ createStyleResolver();
+ } else {
+ if (m_styleResolver->hasPendingAuthorStyleSheets())
esprehn 2013/11/15 10:36:32 else if
tasak 2013/11/18 08:30:53 Done.
+ m_styleResolver->appendPendingAuthorStyleSheets();
+ }
+ return m_styleResolver.get();
+}
+
void Document::createStyleResolver()
{
// It is a programming error to attempt to resolve style on a Document
@@ -1968,7 +1979,7 @@ void Document::createStyleResolver()
ASSERT(frame());
m_styleResolver = adoptPtr(new StyleResolver(*this));
- m_styleEngine->combineCSSFeatureFlags(m_styleResolver->ruleFeatureSet());
+ m_styleEngine->combineCSSFeatureFlags(m_styleResolver->ensureRuleFeatureSet());
}
void Document::clearStyleResolver()

Powered by Google App Engine
This is Rietveld 408576698