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

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

Issue 2644753002: DevTools: untruncate links on copy (Closed)
Patch Set: ac 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/components/DOMPresentationUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js b/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js
index 69a347272ca3a09fe09a012ade9faa168a4111e4..465ee977ab8cef0870dbe38a54b0807d88d07b54 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js
@@ -592,6 +592,27 @@ Components.DOMPresentationUtils._xPathIndex = function(node) {
};
/**
+ * @param {string} truncatedText
+ * @param {string} originalText
+ * @return {!Text}
+ */
+Components.DOMPresentationUtils.createTruncatedTextNode = function(truncatedText, originalText) {
+ var node = createTextNode(truncatedText);
+ node[Components.DOMPresentationUtils._untruncatedTextSymbol] = originalText;
dgozman 2017/04/05 15:45:13 This is only used for Console, let's put it there.
luoe 2017/04/06 02:10:24 I've returned to the approach in patch set 3 where
+ return node;
+};
+
+/**
+ * @param {!Node} node
+ * @return {string}
+ */
+Components.DOMPresentationUtils.originalNodeText = function(node) {
+ if (typeof node[Components.DOMPresentationUtils._untruncatedTextSymbol] === 'string')
+ return node[Components.DOMPresentationUtils._untruncatedTextSymbol];
+ return node.textContent;
+};
+
+/**
* @unrestricted
*/
Components.DOMNodePathStep = class {
@@ -648,3 +669,9 @@ Components.DOMPresentationUtils.GenericDecorator = class {
return {title: this._title, color: this._color};
}
};
+
+/**
+ * @type {symbol}
+ * @const
+ */
+Components.DOMPresentationUtils._untruncatedTextSymbol = Symbol('UntruncatedTextSymbol');

Powered by Google App Engine
This is Rietveld 408576698