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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js

Issue 2856233002: DevTools: support uiLocationToRawLocations for CSS (Closed)
Patch Set: Created 3 years, 8 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/devtools/front_end/sources/SourceFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
index 73fd566f4fd19d21d86fba14d3e47289296c8f42..6c666a70c243f4775d701e2ca96df0fe3540f2e6 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
@@ -257,6 +257,22 @@ Sources.SourceFormatter.StyleMapping = class {
}
/**
+ * @override
+ * @param {!Workspace.UILocation} uiLocation
+ * @return {!Array<!SDK.CSSLocation>}
+ */
+ uiLocationToRawLocations(uiLocation) {
+ var formatData = Sources.SourceFormatData._for(uiLocation.uiSourceCode);
+ if (!formatData)
+ return [];
+ var originalLocation = formatData.mapping.formattedToOriginal(uiLocation.lineNumber, uiLocation.columnNumber);
+ var header = Bindings.NetworkProject.styleHeaderForUISourceCode(formatData.originalSourceCode);
+ if (!header)
+ return [];
+ return [new SDK.CSSLocation(header, originalLocation[0], originalLocation[1])];
+ }
+
+ /**
* @param {!Sources.SourceFormatData} formatData
* @param {boolean} enable
*/

Powered by Google App Engine
This is Rietveld 408576698