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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorStyleSheet.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/inspector/InspectorStyleSheet.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
index 7d306bfe5bbeb3771388d430a3c56a62ff8c5bb9..f3dfbaa0f9b531e5ce647dbfe26b96ca59bc715f 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
@@ -1601,6 +1601,24 @@ InspectorStyleSheet::buildObjectForRuleWithoutMedia(CSSStyleRule* rule) {
return result;
}
+std::unique_ptr<protocol::CSS::RuleUsage>
+InspectorStyleSheet::buildObjectForRuleUsage(CSSRule* rule, bool wasUsed) {
+ CSSStyleSheet* styleSheet = pageStyleSheet();
+ if (!styleSheet)
+ return nullptr;
+
+ CSSRuleSourceData* sourceData = sourceDataForRule(rule);
+
+ std::unique_ptr<protocol::CSS::RuleUsage> result =
+ protocol::CSS::RuleUsage::create()
+ .setStyleSheetId(id())
+ .setRange(buildSourceRangeObject(sourceData->ruleBodyRange))
+ .setUsed(wasUsed)
+ .build();
+
+ return result;
+}
+
std::unique_ptr<protocol::CSS::CSSKeyframeRule>
InspectorStyleSheet::buildObjectForKeyframeRule(CSSKeyframeRule* keyframeRule) {
CSSStyleSheet* styleSheet = pageStyleSheet();

Powered by Google App Engine
This is Rietveld 408576698