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

Unified Diff: Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 676193002: Navigate between individual search matches in DevTools console (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Improve test Created 6 years 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: Source/devtools/front_end/console/ConsoleViewMessage.js
diff --git a/Source/devtools/front_end/console/ConsoleViewMessage.js b/Source/devtools/front_end/console/ConsoleViewMessage.js
index dd05ba096e256e3fddabd5532df5676da529bc3f..eb582a8b26e1d7b01e612c26194e42128e33fe4c 100644
--- a/Source/devtools/front_end/console/ConsoleViewMessage.js
+++ b/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -952,22 +952,12 @@ WebInspector.ConsoleViewMessage.prototype = {
return String.format(format, parameters, formatters, formattedResult, append);
},
- clearHighlight: function()
+ clearHighlights: function()
{
if (!this._formattedMessage)
return;
- WebInspector.removeSearchResultsHighlight(this._formattedMessage);
- },
-
- highlightSearchResults: function(regexObject)
- {
- if (!this._formattedMessage)
- return;
-
- this._highlightSearchResultsInElement(regexObject, this._messageElement);
- if (this._anchorElement)
- this._highlightSearchResultsInElement(regexObject, this._anchorElement);
+ WebInspector.removeSearchResultsHighlight(this._formattedMessage, WebInspector.highlightedSearchResultClassName);
},
_highlightSearchResultsInElement: function(regexObject, element)
@@ -1284,6 +1274,28 @@ WebInspector.ConsoleViewMessage.prototype = {
},
/**
+ * @return {string}
+ */
+ renderedText: function ()
+ {
+ if (!this._messageElement)
+ return "";
+ return this._messageElement.textContent;
+ },
+
+ /**
+ * @param {!Array.<!Object>} ranges
+ * @return {!Array.<!Element>}
+ */
+ highlightMatches: function(ranges)
+ {
+ var highlightNodes = [];
+ if (this._formattedMessage)
+ highlightNodes = WebInspector.highlightSearchResults(this._messageElement, ranges);
+ return highlightNodes;
+ },
+
+ /**
* @param {string} string
* @return {?Element}
*/

Powered by Google App Engine
This is Rietveld 408576698