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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js

Issue 2644753002: DevTools: untruncate links on copy (Closed)
Patch Set: reset tests with zero width space Created 3 years, 8 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/console/ConsoleViewport.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js
index 89ae0cb8d8aa72efdc67e9af54f02d97030c76eb..6ce609b2bc772fca99319610a793bb730d98a418 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js
@@ -423,8 +423,11 @@ Console.ConsoleViewport = class {
}
var textLines = [];
- for (var i = startSelection.item; i <= endSelection.item; ++i)
- textLines.push(this._providerElement(i).element().deepTextContent());
+ for (var i = startSelection.item; i <= endSelection.item; ++i) {
+ var element = this._providerElement(i).element();
+ var lineContent = element.childTextNodes().map(Components.Linkifier.originalNodeText).join('');
+ textLines.push(lineContent);
+ }
var endSelectionElement = this._providerElement(endSelection.item).element();
if (endSelection.node && endSelection.node.isSelfOrDescendant(endSelectionElement)) {
@@ -459,8 +462,8 @@ Console.ConsoleViewport = class {
var chars = 0;
var node = itemElement;
while ((node = node.traverseNextTextNode(itemElement)) && !node.isSelfOrDescendant(container))
- chars += node.textContent.length;
- return chars + offset;
+ chars += Components.Linkifier.originalNodeText(node).length;
+ return chars + Components.Linkifier.selectionOffsetToOriginalTextOffset(container, offset);
}
/**

Powered by Google App Engine
This is Rietveld 408576698