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

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

Issue 2455943003: Backend for css rule tracking (Closed)
Patch Set: Backend for CSS Rule tracking. Created 4 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: third_party/WebKit/Source/core/dom/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index 9b5866ef5b46146e2ab6d35aa5be07ace2b87db0..701d7a59f70f72e34287e560014b5e012dc95393 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -38,6 +38,7 @@
#include "core/css/invalidation/InvalidationSet.h"
#include "core/css/resolver/ScopedStyleResolver.h"
#include "core/css/resolver/SharedStyleFinder.h"
+#include "core/css/resolver/StyleRuleUsageTracker.h"
#include "core/css/resolver/ViewportStyleResolver.h"
#include "core/dom/DocumentStyleSheetCollector.h"
#include "core/dom/Element.h"
@@ -424,9 +425,18 @@ void StyleEngine::appendActiveAuthorStyleSheets() {
}
}
+void StyleEngine::setRuleUsageTracker(StyleRuleUsageTracker* tracker) {
+ m_tracker = tracker;
+
+ if (m_resolver)
+ m_resolver->setRuleUsageTracker(m_tracker);
+}
+
void StyleEngine::createResolver() {
m_resolver = StyleResolver::create(*m_document);
+ m_resolver->setRuleUsageTracker(m_tracker);
+
// A scoped style resolver for document will be created during
// appendActiveAuthorStyleSheets if needed.
appendActiveAuthorStyleSheets();
@@ -1050,6 +1060,7 @@ DEFINE_TRACE(StyleEngine) {
visitor->trace(m_fontSelector);
visitor->trace(m_textToSheetCache);
visitor->trace(m_sheetToTextCache);
+ visitor->trace(m_tracker);
CSSFontSelectorClient::trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698