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

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

Issue 2900733003: DevTools: fix offset condition in console viewport _selectedText and add tests (Closed)
Patch Set: fix offset correction condition Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6341e4a282ddb72bbbaf8150037b429c1ee1f4e5..f61e49ac56524a6c1de5c8a6de0b13ffec6198e1 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewport.js
@@ -466,9 +466,9 @@ Console.ConsoleViewport = class {
continue;
chars += Components.Linkifier.untruncatedNodeText(node).length;
}
- // If the selection offset is at the end of a link's ellipsis, use the untruncated length as offset.
+ // If the selected node text was truncated, treat any non-zero offset as the full length.
var untruncatedContainerLength = Components.Linkifier.untruncatedNodeText(selectionNode).length;
- if (offset === 1 && untruncatedContainerLength > offset)
+ if (offset > 0 && untruncatedContainerLength !== selectionNode.textContent.length)
offset = untruncatedContainerLength;
return chars + offset;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698