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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 if (!linkText) | 503 if (!linkText) |
504 linkText = url; | 504 linkText = url; |
505 classes = (classes ? classes + " " : ""); | 505 classes = (classes ? classes + " " : ""); |
506 classes += isExternal ? "webkit-html-external-link" : "webkit-html-resource- link"; | 506 classes += isExternal ? "webkit-html-external-link" : "webkit-html-resource- link"; |
507 | 507 |
508 var a = createElement("a"); | 508 var a = createElement("a"); |
509 var href = sanitizeHref(url); | 509 var href = sanitizeHref(url); |
510 if (href !== null) | 510 if (href !== null) |
511 a.href = href; | 511 a.href = href; |
512 a.className = classes; | 512 a.className = classes; |
513 if (typeof tooltipText === "undefined") | 513 if (!tooltipText && linkText !== url) |
pfeldman
2015/08/19 19:08:42
What about the ones with the overflow?
samli
2015/08/21 01:31:47
I have not been able to find any instance of this.
| |
514 a.title = url; | 514 a.title = url; |
515 else if (typeof tooltipText !== "string" || tooltipText.length) | 515 else if (tooltipText) |
516 a.title = tooltipText; | 516 a.title = tooltipText; |
517 a.textContent = linkText.trimMiddle(WebInspector.Linkifier.MaxLengthForDispl ayedURLs); | 517 a.textContent = linkText.trimMiddle(WebInspector.Linkifier.MaxLengthForDispl ayedURLs); |
518 if (isExternal) | 518 if (isExternal) |
519 a.setAttribute("target", "_blank"); | 519 a.setAttribute("target", "_blank"); |
520 | 520 |
521 return a; | 521 return a; |
522 } | 522 } |
523 | 523 |
524 /** | 524 /** |
525 * @param {string} article | 525 * @param {string} article |
(...skipping 26 matching lines...) Expand all Loading... | |
552 /** | 552 /** |
553 * @param {!WebInspector.NetworkRequest} request | 553 * @param {!WebInspector.NetworkRequest} request |
554 * @return {!Element} | 554 * @return {!Element} |
555 */ | 555 */ |
556 WebInspector.linkifyRequestAsNode = function(request) | 556 WebInspector.linkifyRequestAsNode = function(request) |
557 { | 557 { |
558 var anchor = WebInspector.linkifyURLAsNode(request.url); | 558 var anchor = WebInspector.linkifyURLAsNode(request.url); |
559 anchor.requestId = request.requestId; | 559 anchor.requestId = request.requestId; |
560 return anchor; | 560 return anchor; |
561 } | 561 } |
OLD | NEW |