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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components/Linkifier.js

Issue 2151653005: DevTools: Do not linkify to pseudo (program) node when there's no URL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update a test expectation. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
index c1c0279ca26fc9e1d7a8b630dcfa68e2d673ce04..deac2847500b20f1227d3cf851c61fc87e486a35 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
@@ -160,19 +160,20 @@ WebInspector.Linkifier.prototype = {
* @param {number} lineNumber
* @param {number=} columnNumber
* @param {string=} classes
- * @return {!Element}
+ * @return {?Element}
*/
linkifyScriptLocation: function(target, scriptId, sourceURL, lineNumber, columnNumber, classes)
dgozman 2016/07/15 23:24:22 This is used in ConsoleViewMessage._tryFormatAsErr
{
- var fallbackAnchor = WebInspector.linkifyResourceAsNode(sourceURL, lineNumber, columnNumber, classes);
+ var fallbackAnchor = sourceURL ? WebInspector.linkifyResourceAsNode(sourceURL, lineNumber, columnNumber, classes) : null;
if (!target || target.isDetached())
return fallbackAnchor;
var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
if (!debuggerModel)
return fallbackAnchor;
- var rawLocation = scriptId ? debuggerModel.createRawLocationByScriptId(scriptId, lineNumber, columnNumber || 0) :
- debuggerModel.createRawLocationByURL(sourceURL, lineNumber, columnNumber || 0);
+ var rawLocation = scriptId && scriptId !== "0"
dgozman 2016/07/15 23:24:22 Let's rather fix backend to send empty string or b
+ ? debuggerModel.createRawLocationByScriptId(scriptId, lineNumber, columnNumber || 0)
+ : debuggerModel.createRawLocationByURL(sourceURL, lineNumber, columnNumber || 0);
if (!rawLocation)
return fallbackAnchor;
@@ -189,7 +190,7 @@ WebInspector.Linkifier.prototype = {
* @param {!WebInspector.DebuggerModel.Location} rawLocation
* @param {string} fallbackUrl
* @param {string=} classes
- * @return {!Element}
+ * @return {?Element}
*/
linkifyRawLocation: function(rawLocation, fallbackUrl, classes)
dgozman 2016/07/15 23:24:22 This is used in ObjectPopoverHelper._showObjectPop
{
@@ -200,7 +201,7 @@ WebInspector.Linkifier.prototype = {
* @param {?WebInspector.Target} target
* @param {!RuntimeAgent.CallFrame} callFrame
* @param {string=} classes
- * @return {!Element}
+ * @return {?Element}
*/
linkifyConsoleCallFrame: function(target, callFrame, classes)
{
@@ -211,7 +212,7 @@ WebInspector.Linkifier.prototype = {
* @param {?WebInspector.Target} target
* @param {!RuntimeAgent.CallFrame} callFrame
* @param {string=} classes
- * @return {!Element}
+ * @return {?Element}
*/
linkifyConsoleCallFrameForTimeline: function(target, callFrame, classes)
{

Powered by Google App Engine
This is Rietveld 408576698