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

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: Synchronize with origin Created 5 years, 11 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
« no previous file with comments | « Source/devtools/front_end/console/ConsoleView.js ('k') | Source/devtools/front_end/console/consoleView.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2b79ff628cc2d5f5ebdb7a518e722ac50cc75ad3..810dffd8d3653e320f22264776919fde3aa762a3 100644
--- a/Source/devtools/front_end/console/ConsoleViewMessage.js
+++ b/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -958,22 +958,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)
@@ -1290,6 +1280,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}
*/
« no previous file with comments | « Source/devtools/front_end/console/ConsoleView.js ('k') | Source/devtools/front_end/console/consoleView.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698