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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2296323002: DevTools: Add features to collect classnames from Stylesheets and DOM (Closed)
Patch Set: Created 4 years, 4 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/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index fbd395b0546bb4c75aa89484aaad029e6ba84b8a..c06db408825cdd1d785f173a0c46b6b2adb929d6 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -1083,6 +1083,16 @@ void InspectorCSSAgent::getStyleSheetText(ErrorString* errorString, const String
inspectorStyleSheet->getText(result);
}
+void InspectorCSSAgent::collectClassNamesFromStyleSheet(ErrorString* errorString, const String& styleSheetId, Maybe<protocol::Array<String>>* classNames)
+{
+ IdToInspectorStyleSheet::iterator it = m_idToInspectorStyleSheet.find(styleSheetId);
+ if (it == m_idToInspectorStyleSheet.end()) {
+ *errorString = "No style sheet with given id found";
+ return;
+ }
+ *classNames = it->value.get()->collectClassNames();
+}
+
void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String& styleSheetId, const String& text, protocol::Maybe<String>* sourceMapURL)
{
FrontendOperationScope scope;

Powered by Google App Engine
This is Rietveld 408576698