| OLD | NEW |
| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return this.linkifyRawLocation(rawLocation, classes); | 124 return this.linkifyRawLocation(rawLocation, classes); |
| 125 }, | 125 }, |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 128 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
| 129 * @param {string=} classes | 129 * @param {string=} classes |
| 130 * @return {?Element} | 130 * @return {?Element} |
| 131 */ | 131 */ |
| 132 linkifyRawLocation: function(rawLocation, classes) | 132 linkifyRawLocation: function(rawLocation, classes) |
| 133 { | 133 { |
| 134 var script = WebInspector.debuggerModel.scriptForId(rawLocation.scriptId
); | 134 // FIXME: this check should not be here. |
| 135 var script = rawLocation.target().debuggerModel.scriptForId(rawLocation.
scriptId); |
| 135 if (!script) | 136 if (!script) |
| 136 return null; | 137 return null; |
| 137 var anchor = this._createAnchor(classes); | 138 var anchor = this._createAnchor(classes); |
| 138 var liveLocation = script.createLiveLocation(rawLocation, this._updateAn
chor.bind(this, anchor)); | 139 var liveLocation = rawLocation.createLiveLocation(this._updateAnchor.bin
d(this, anchor)); |
| 139 this._liveLocations.push(liveLocation); | 140 this._liveLocations.push(liveLocation); |
| 140 return anchor; | 141 return anchor; |
| 141 }, | 142 }, |
| 142 | 143 |
| 143 /** | 144 /** |
| 144 * @param {?CSSAgent.StyleSheetId} styleSheetId | 145 * @param {?CSSAgent.StyleSheetId} styleSheetId |
| 145 * @param {!WebInspector.CSSLocation} rawLocation | 146 * @param {!WebInspector.CSSLocation} rawLocation |
| 146 * @param {string=} classes | 147 * @param {string=} classes |
| 147 * @return {?Element} | 148 * @return {?Element} |
| 148 */ | 149 */ |
| 149 linkifyCSSLocation: function(styleSheetId, rawLocation, classes) | 150 linkifyCSSLocation: function(styleSheetId, rawLocation, classes) |
| 150 { | 151 { |
| 151 var anchor = this._createAnchor(classes); | 152 var anchor = this._createAnchor(classes); |
| 152 var liveLocation = WebInspector.cssModel.createLiveLocation(styleSheetId
, rawLocation, this._updateAnchor.bind(this, anchor)); | 153 var liveLocation = rawLocation.createLiveLocation(styleSheetId, this._up
dateAnchor.bind(this, anchor)); |
| 153 if (!liveLocation) | 154 if (!liveLocation) |
| 154 return null; | 155 return null; |
| 155 this._liveLocations.push(liveLocation); | 156 this._liveLocations.push(liveLocation); |
| 156 return anchor; | 157 return anchor; |
| 157 }, | 158 }, |
| 158 | 159 |
| 159 /** | 160 /** |
| 160 * @param {string=} classes | 161 * @param {string=} classes |
| 161 * @return {!Element} | 162 * @return {!Element} |
| 162 */ | 163 */ |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 * @param {number=} columnNumber | 284 * @param {number=} columnNumber |
| 284 */ | 285 */ |
| 285 WebInspector.Linkifier.liveLocationText = function(scriptId, lineNumber, columnN
umber) | 286 WebInspector.Linkifier.liveLocationText = function(scriptId, lineNumber, columnN
umber) |
| 286 { | 287 { |
| 287 var script = WebInspector.debuggerModel.scriptForId(scriptId); | 288 var script = WebInspector.debuggerModel.scriptForId(scriptId); |
| 288 if (!script) | 289 if (!script) |
| 289 return ""; | 290 return ""; |
| 290 var uiLocation = script.rawLocationToUILocation(lineNumber, columnNumber); | 291 var uiLocation = script.rawLocationToUILocation(lineNumber, columnNumber); |
| 291 return uiLocation.linkText(); | 292 return uiLocation.linkText(); |
| 292 } | 293 } |
| OLD | NEW |