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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js

Issue 2893523002: DevTools: make StyleSourceMapping in charge of managing UISourceCodes (Closed)
Patch Set: update test Created 3 years, 7 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/bindings/CSSWorkspaceBinding.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
index f0278e20d4ea23da65b02ff4a73ec8cf2848d955..16bc85f6534aaf88302ce6dba5d6e2b7f6ec0819 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
@@ -140,6 +140,7 @@ Bindings.CSSWorkspaceBinding.ModelInfo = class {
* @param {!Workspace.Workspace} workspace
*/
constructor(cssModel, workspace) {
+ this._workspace = workspace;
this._eventListeners = [
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this),
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this)
@@ -229,7 +230,16 @@ Bindings.CSSWorkspaceBinding.ModelInfo = class {
var uiLocation = null;
uiLocation = uiLocation || this._sassSourceMapping.rawLocationToUILocation(rawLocation);
uiLocation = uiLocation || this._stylesSourceMapping.rawLocationToUILocation(rawLocation);
- return uiLocation;
+ if (uiLocation)
+ return uiLocation;
+ var header = rawLocation.header();
+ if (!header)
+ return null;
+ var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForResourceURL(
dgozman 2017/05/17 16:46:20 Should we have a ResourceMapping which will do thi
lushnikov 2017/05/20 01:24:18 Done - introduced here: https://codereview.chromiu
+ header.cssModel().target(), this._workspace, rawLocation.url, header.frameId);
+ if (!uiSourceCode)
+ return null;
+ return uiSourceCode.uiLocation(rawLocation.lineNumber, rawLocation.columnNumber);
}
/**

Powered by Google App Engine
This is Rietveld 408576698