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

Unified Diff: third_party/WebKit/Source/core/css/ElementRuleCollector.cpp

Issue 1644543002: Moved element style recalc count and stats to StyleEngine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/core/css/ElementRuleCollector.cpp
diff --git a/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp b/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp
index a98de1afa68b1c00b782eab7b8cef0039b2b422e..d9f08d560e9ead8864d431902344db75188fdd26 100644
--- a/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp
+++ b/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp
@@ -39,6 +39,7 @@
#include "core/css/StylePropertySet.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/css/resolver/StyleResolverStats.h"
+#include "core/dom/StyleEngine.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/style/StyleInheritedData.h"
#include <algorithm>
@@ -170,11 +171,13 @@ void ElementRuleCollector::collectMatchingRulesForList(const RuleDataListType* r
didMatchRule(ruleData, result, cascadeOrder, matchRequest);
}
- if (StyleResolver* resolver = m_context.element()->document().styleResolver()) {
- INCREMENT_STYLE_STATS_COUNTER(*resolver, rulesRejected, rejected);
- INCREMENT_STYLE_STATS_COUNTER(*resolver, rulesFastRejected, fastRejected);
- INCREMENT_STYLE_STATS_COUNTER(*resolver, rulesMatched, matched);
- }
+ StyleEngine& styleEngine = m_context.element()->document().styleEngine();
+ if (!styleEngine.stats())
+ return;
+
+ INCREMENT_STYLE_STATS_COUNTER(styleEngine, rulesRejected, rejected);
+ INCREMENT_STYLE_STATS_COUNTER(styleEngine, rulesFastRejected, fastRejected);
+ INCREMENT_STYLE_STATS_COUNTER(styleEngine, rulesMatched, matched);
}
void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules)

Powered by Google App Engine
This is Rietveld 408576698