Chromium Code Reviews| 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'); |