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

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

Issue 2893073002: DevTools: introduce ResourceMapping (Closed)
Patch Set: cleanup 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..c4174ad005a632c269a70a97cbf0658918f499e1 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();
this._eventListeners = [
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetAdded, this._styleSheetAdded, this),
cssModel.addEventListener(SDK.CSSModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this)
@@ -229,7 +230,11 @@ 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 resourceBinding = Bindings.ResourceBinding.forTarget(this._target);
+ var uiSourceCode = resourceBinding ? resourceBinding.uiSourceCodeForURL(rawLocation.url) : null;
dgozman 2017/05/19 23:51:05 Bindings.ResourceBinding.uiSourceCodeForURL(this._
lushnikov 2017/06/09 01:29:07 Done.
+ return uiSourceCode ? uiSourceCode.uiLocation(rawLocation.lineNumber, rawLocation.columnNumber) : null;
}
/**

Powered by Google App Engine
This is Rietveld 408576698