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

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

Issue 2893073002: DevTools: introduce ResourceMapping (Closed)
Patch Set: rebaseline Created 3 years, 6 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 c1f972b677a4d58ca27f8dc25ee5ad3c86e7b6ad..496427d372150be860beb01ed3e01bdb2231bb47 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._target = cssModel.target();
dgozman 2017/06/12 18:48:50 drop
lushnikov 2017/06/12 22:05:56 Done.
this._eventListeners = [
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this),
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this)
@@ -229,7 +230,10 @@ 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 uiSourceCode = Bindings.resourceBindingManager.uiSourceCodeForURL(this._target, rawLocation.url);
dgozman 2017/06/12 18:48:50 cssLocationToUILocation(cssLocation) and jsLocatio
lushnikov 2017/06/12 22:05:56 Done.
+ return uiSourceCode ? uiSourceCode.uiLocation(rawLocation.lineNumber, rawLocation.columnNumber) : null;
}
/**

Powered by Google App Engine
This is Rietveld 408576698