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

Side by Side Diff: Source/devtools/front_end/sdk/Linkifier.js

Issue 404763002: DevTools: Inject styleSheetId in WebInspector.CSSLocation constructor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 var script = rawLocation.target().debuggerModel.scriptForId(rawLocation. scriptId); 189 var script = rawLocation.target().debuggerModel.scriptForId(rawLocation. scriptId);
190 if (!script) 190 if (!script)
191 return null; 191 return null;
192 var anchor = this._createAnchor(classes); 192 var anchor = this._createAnchor(classes);
193 var liveLocation = rawLocation.createLiveLocation(this._updateAnchor.bin d(this, anchor)); 193 var liveLocation = rawLocation.createLiveLocation(this._updateAnchor.bin d(this, anchor));
194 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation}); 194 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation});
195 return anchor; 195 return anchor;
196 }, 196 },
197 197
198 /** 198 /**
199 * @param {?CSSAgent.StyleSheetId} styleSheetId
200 * @param {!WebInspector.CSSLocation} rawLocation 199 * @param {!WebInspector.CSSLocation} rawLocation
201 * @param {string=} classes 200 * @param {string=} classes
202 * @return {?Element} 201 * @return {?Element}
203 */ 202 */
204 linkifyCSSLocation: function(styleSheetId, rawLocation, classes) 203 linkifyCSSLocation: function(rawLocation, classes)
205 { 204 {
206 var anchor = this._createAnchor(classes); 205 var anchor = this._createAnchor(classes);
207 var liveLocation = rawLocation.createLiveLocation(styleSheetId, this._up dateAnchor.bind(this, anchor)); 206 var liveLocation = rawLocation.createLiveLocation(this._updateAnchor.bin d(this, anchor));
208 if (!liveLocation) 207 if (!liveLocation)
209 return null; 208 return null;
210 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation}); 209 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation});
211 return anchor; 210 return anchor;
212 }, 211 },
213 212
214 /** 213 /**
215 * @param {string=} classes 214 * @param {string=} classes
216 * @return {!Element} 215 * @return {!Element}
217 */ 216 */
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 * @return {string} 343 * @return {string}
345 */ 344 */
346 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber, columnNumber) 345 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber, columnNumber)
347 { 346 {
348 var script = target.debuggerModel.scriptForId(scriptId); 347 var script = target.debuggerModel.scriptForId(scriptId);
349 if (!script) 348 if (!script)
350 return ""; 349 return "";
351 var uiLocation = script.rawLocationToUILocation(lineNumber, columnNumber); 350 var uiLocation = script.rawLocationToUILocation(lineNumber, columnNumber);
352 return uiLocation.linkText(); 351 return uiLocation.linkText();
353 } 352 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698