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) |