| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 * @param {?WebInspector.Target} target | 195 * @param {?WebInspector.Target} target |
| 196 * @param {!RuntimeAgent.CallFrame} callFrame | 196 * @param {!RuntimeAgent.CallFrame} callFrame |
| 197 * @param {string=} classes | 197 * @param {string=} classes |
| 198 * @return {!Element} | 198 * @return {!Element} |
| 199 */ | 199 */ |
| 200 linkifyConsoleCallFrame: function(target, callFrame, classes) | 200 linkifyConsoleCallFrame: function(target, callFrame, classes) |
| 201 { | 201 { |
| 202 // FIXME(62725): console stack trace line/column numbers are one-based. | 202 // FIXME(62725): console stack trace line/column numbers are one-based. |
| 203 var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0; | 203 var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0; |
| 204 var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 :
0; | 204 var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 :
0; |
| 205 var anchor = this.linkifyScriptLocation(target, callFrame.scriptId, call
Frame.url, lineNumber, columnNumber, classes); | 205 return this.linkifyScriptLocation(target, callFrame.scriptId, callFrame.
url, lineNumber, columnNumber, classes); |
| 206 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); | |
| 207 var location = debuggerModel && debuggerModel.createRawLocationByScriptI
d(callFrame.scriptId, callFrame.lineNumber, callFrame.columnNumber); | |
| 208 var blackboxed = location ? | |
| 209 WebInspector.blackboxManager.isBlackboxedRawLocation(location) : | |
| 210 WebInspector.blackboxManager.isBlackboxedURL(callFrame.url); | |
| 211 if (blackboxed) | |
| 212 anchor.classList.add("webkit-html-blackbox-link"); | |
| 213 | |
| 214 return anchor; | |
| 215 }, | 206 }, |
| 216 | 207 |
| 217 /** | 208 /** |
| 218 * @param {!WebInspector.CSSLocation} rawLocation | 209 * @param {!WebInspector.CSSLocation} rawLocation |
| 219 * @param {string=} classes | 210 * @param {string=} classes |
| 220 * @return {!Element} | 211 * @return {!Element} |
| 221 */ | 212 */ |
| 222 linkifyCSSLocation: function(rawLocation, classes) | 213 linkifyCSSLocation: function(rawLocation, classes) |
| 223 { | 214 { |
| 224 var anchor = this._createAnchor(classes); | 215 var anchor = this._createAnchor(classes); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 274 |
| 284 dispose: function() | 275 dispose: function() |
| 285 { | 276 { |
| 286 this.reset(); | 277 this.reset(); |
| 287 WebInspector.targetManager.unobserveTargets(this); | 278 WebInspector.targetManager.unobserveTargets(this); |
| 288 this._liveLocationsByTarget.clear(); | 279 this._liveLocationsByTarget.clear(); |
| 289 }, | 280 }, |
| 290 | 281 |
| 291 /** | 282 /** |
| 292 * @param {!Element} anchor | 283 * @param {!Element} anchor |
| 293 * @param {!WebInspector.UILocation} uiLocation | 284 * @param {!WebInspector.LiveLocation} liveLocation |
| 294 */ | 285 */ |
| 295 _updateAnchor: function(anchor, uiLocation) | 286 _updateAnchor: function(anchor, liveLocation) |
| 296 { | 287 { |
| 288 var uiLocation = /** @type {!WebInspector.UILocation} */(liveLocation.ui
Location); |
| 297 anchor[WebInspector.Linkifier._uiLocationSymbol] = uiLocation; | 289 anchor[WebInspector.Linkifier._uiLocationSymbol] = uiLocation; |
| 298 this._formatter.formatLiveAnchor(anchor, uiLocation); | 290 this._formatter.formatLiveAnchor(anchor, uiLocation); |
| 299 } | 291 } |
| 300 } | 292 } |
| 301 | 293 |
| 302 /** | 294 /** |
| 303 * @param {!Element} anchor | 295 * @param {!Element} anchor |
| 304 * @return {?WebInspector.UILocation} uiLocation | 296 * @return {?WebInspector.UILocation} uiLocation |
| 305 */ | 297 */ |
| 306 WebInspector.Linkifier.uiLocationByAnchor = function(anchor) | 298 WebInspector.Linkifier.uiLocationByAnchor = function(anchor) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 329 var text = uiLocation.linkText(); | 321 var text = uiLocation.linkText(); |
| 330 text = text.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g, "$1\u2026"); | 322 text = text.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g, "$1\u2026"); |
| 331 if (this._maxLength) | 323 if (this._maxLength) |
| 332 text = text.trimMiddle(this._maxLength); | 324 text = text.trimMiddle(this._maxLength); |
| 333 anchor.textContent = text; | 325 anchor.textContent = text; |
| 334 | 326 |
| 335 var titleText = uiLocation.uiSourceCode.url(); | 327 var titleText = uiLocation.uiSourceCode.url(); |
| 336 if (typeof uiLocation.lineNumber === "number") | 328 if (typeof uiLocation.lineNumber === "number") |
| 337 titleText += ":" + (uiLocation.lineNumber + 1); | 329 titleText += ":" + (uiLocation.lineNumber + 1); |
| 338 anchor.title = titleText; | 330 anchor.title = titleText; |
| 331 |
| 332 if (uiLocation.isBlackboxed) |
| 333 anchor.classList.add("webkit-html-blackbox-link"); |
| 334 else |
| 335 anchor.classList.remove("webkit-html-blackbox-link"); |
| 339 } | 336 } |
| 340 } | 337 } |
| 341 | 338 |
| 342 /** | 339 /** |
| 343 * @constructor | 340 * @constructor |
| 344 * @extends {WebInspector.Linkifier.DefaultFormatter} | 341 * @extends {WebInspector.Linkifier.DefaultFormatter} |
| 345 */ | 342 */ |
| 346 WebInspector.Linkifier.DefaultCSSFormatter = function() | 343 WebInspector.Linkifier.DefaultCSSFormatter = function() |
| 347 { | 344 { |
| 348 WebInspector.Linkifier.DefaultFormatter.call(this, WebInspector.Linkifier.De
faultCSSFormatter.MaxLengthForDisplayedURLs); | 345 WebInspector.Linkifier.DefaultFormatter.call(this, WebInspector.Linkifier.De
faultCSSFormatter.MaxLengthForDisplayedURLs); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 /** | 538 /** |
| 542 * @param {!WebInspector.NetworkRequest} request | 539 * @param {!WebInspector.NetworkRequest} request |
| 543 * @return {!Element} | 540 * @return {!Element} |
| 544 */ | 541 */ |
| 545 WebInspector.linkifyRequestAsNode = function(request) | 542 WebInspector.linkifyRequestAsNode = function(request) |
| 546 { | 543 { |
| 547 var anchor = WebInspector.linkifyURLAsNode(request.url); | 544 var anchor = WebInspector.linkifyURLAsNode(request.url); |
| 548 anchor.requestId = request.requestId; | 545 anchor.requestId = request.requestId; |
| 549 return anchor; | 546 return anchor; |
| 550 } | 547 } |
| OLD | NEW |