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 1a77e9750f7711779fb9fda5e39656600c8e6b52..2489bb08886533872b9cba9136520abb36173e11 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
@@ -657,7 +657,7 @@ WebInspector.ConsoleView.prototype = { |
var lines = []; |
for (var i = 0; i < chunkSize && i + messageIndex < this.itemCount(); ++i) { |
var message = this.itemElement(messageIndex + i); |
- lines.push(message.searchableElement().deepTextContent()); |
+ lines.push(message.formattedMessage().deepTextContent()); |
lushnikov
2016/09/06 19:30:29
why do we still use formatMessage?
luoe
2016/09/06 21:50:29
My bad, I didn't remove formattedMessage() uses in
|
} |
messageIndex += i; |
stream.write(lines.join("\n") + "\n", writeNextChunk.bind(this)); |
@@ -1235,11 +1235,15 @@ WebInspector.ConsoleCommand = function(message, linkifier, nestingLevel) |
WebInspector.ConsoleCommand.prototype = { |
/** |
* @override |
- * @return {!Element}) |
+ * @return {!Element} |
*/ |
- searchableElement: function() |
+ formattedMessage: function() |
{ |
- return this.contentElement(); |
+ if (this._formattedMessage) |
+ return this._formattedMessage; |
+ this._formattedMessage = createElementWithClass("span", "console-message-text source-code"); |
+ this._formattedMessage.textContent = this.text.replaceControlCharacters(); |
+ return this._formattedMessage; |
}, |
/** |
@@ -1251,14 +1255,11 @@ WebInspector.ConsoleCommand.prototype = { |
if (!this._element) { |
this._element = createElementWithClass("div", "console-user-command"); |
this._element.message = this; |
+ this._element.appendChild(this.formattedMessage()); |
- this._formattedCommand = createElementWithClass("span", "console-message-text source-code"); |
- this._formattedCommand.textContent = this.text.replaceControlCharacters(); |
- this._element.appendChild(this._formattedCommand); |
- |
- if (this._formattedCommand.textContent.length < WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter) { |
+ if (this._formattedMessage.textContent.length < WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter) { |
var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript", true); |
- javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand).then(this._updateSearch.bind(this)) |
+ javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedMessage).then(this._updateSearch.bind(this)) |
} else { |
this._updateSearch(); |
} |