Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
| index 14ea9163233aac7ca023995c716cda4d134ea920..588a2c6d370dbb8ead72418694bc9ed536a73315 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
| @@ -1192,8 +1192,12 @@ WebInspector.ConsoleCommand.prototype = { |
| this._formattedCommand.textContent = this.text.replaceControlCharacters(); |
| this._element.appendChild(this._formattedCommand); |
| - var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript", true); |
| - javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand).then(this._updateSearch.bind(this)) |
| + if (this._formattedCommand.textContent.length < WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter) { |
| + var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript", true); |
| + javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand).then(this._updateSearch.bind(this)) |
| + } else { |
| + this._updateSearch.bind(this); |
|
dgozman
2016/06/14 08:55:04
this._updateSearch();
luoe
2016/06/14 18:29:54
Done.
|
| + } |
| } |
| return this._element; |
| }, |
| @@ -1207,6 +1211,13 @@ WebInspector.ConsoleCommand.prototype = { |
| } |
| /** |
| + * The maximum length before strings are considered too long for syntax highlighting. |
| + * @const |
| + * @type {number} |
| + */ |
| +WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter = 10000; |
| + |
| +/** |
| * @constructor |
| * @extends {WebInspector.ConsoleViewMessage} |
| * @param {!WebInspector.ConsoleMessage} message |