 Chromium Code Reviews
 Chromium Code Reviews Issue 1688283002:
  [DevTools] Blackboxing in LiveLocations is supported in Linkifier  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-map-support-v3
    
  
    Issue 1688283002:
  [DevTools] Blackboxing in LiveLocations is supported in Linkifier  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-map-support-v3| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 var text = uiLocation.linkText(); | 320 var text = uiLocation.linkText(); | 
| 330 text = text.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g, "$1\u2026"); | 321 text = text.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g, "$1\u2026"); | 
| 331 if (this._maxLength) | 322 if (this._maxLength) | 
| 332 text = text.trimMiddle(this._maxLength); | 323 text = text.trimMiddle(this._maxLength); | 
| 333 anchor.textContent = text; | 324 anchor.textContent = text; | 
| 334 | 325 | 
| 335 var titleText = uiLocation.uiSourceCode.url(); | 326 var titleText = uiLocation.uiSourceCode.url(); | 
| 336 if (typeof uiLocation.lineNumber === "number") | 327 if (typeof uiLocation.lineNumber === "number") | 
| 337 titleText += ":" + (uiLocation.lineNumber + 1); | 328 titleText += ":" + (uiLocation.lineNumber + 1); | 
| 338 anchor.title = titleText; | 329 anchor.title = titleText; | 
| 330 | |
| 331 if (uiLocation.isBlackboxed) | |
| 332 anchor.classList.add("webkit-html-blackbox-link"); | |
| 
dgozman
2016/02/17 22:46:22
classList.toggle(...)
 
kozy
2016/02/18 01:52:25
This update can be called if blackboxed state wasn
 | |
| 333 else | |
| 334 anchor.classList.remove("webkit-html-blackbox-link"); | |
| 339 } | 335 } | 
| 340 } | 336 } | 
| 341 | 337 | 
| 342 /** | 338 /** | 
| 343 * @constructor | 339 * @constructor | 
| 344 * @extends {WebInspector.Linkifier.DefaultFormatter} | 340 * @extends {WebInspector.Linkifier.DefaultFormatter} | 
| 345 */ | 341 */ | 
| 346 WebInspector.Linkifier.DefaultCSSFormatter = function() | 342 WebInspector.Linkifier.DefaultCSSFormatter = function() | 
| 347 { | 343 { | 
| 348 WebInspector.Linkifier.DefaultFormatter.call(this, WebInspector.Linkifier.De faultCSSFormatter.MaxLengthForDisplayedURLs); | 344 WebInspector.Linkifier.DefaultFormatter.call(this, WebInspector.Linkifier.De faultCSSFormatter.MaxLengthForDisplayedURLs); | 
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 541 /** | 537 /** | 
| 542 * @param {!WebInspector.NetworkRequest} request | 538 * @param {!WebInspector.NetworkRequest} request | 
| 543 * @return {!Element} | 539 * @return {!Element} | 
| 544 */ | 540 */ | 
| 545 WebInspector.linkifyRequestAsNode = function(request) | 541 WebInspector.linkifyRequestAsNode = function(request) | 
| 546 { | 542 { | 
| 547 var anchor = WebInspector.linkifyURLAsNode(request.url); | 543 var anchor = WebInspector.linkifyURLAsNode(request.url); | 
| 548 anchor.requestId = request.requestId; | 544 anchor.requestId = request.requestId; | 
| 549 return anchor; | 545 return anchor; | 
| 550 } | 546 } | 
| OLD | NEW |