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

Unified Diff: Source/devtools/front_end/ui/UIUtils.js

Issue 676193002: Navigate between individual search matches in DevTools console (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Add tests Created 6 years, 1 month 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/ui/UIUtils.js
diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js
index 62bce6d70212b9851418b62f133749f79630835f..0a8c2a09c25d07867ad331490038a9aaa7c480d5 100644
--- a/Source/devtools/front_end/ui/UIUtils.js
+++ b/Source/devtools/front_end/ui/UIUtils.js
@@ -29,6 +29,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+WebInspector.highlightedSearchResultClassName = "highlighted-search-result";
+WebInspector.currentHighlightedSearchResultClassName = "current-search-result";
+
/**
* @param {!Element} element
* @param {?function(!MouseEvent): boolean} elementDragStart
@@ -788,7 +791,8 @@ WebInspector.highlightSearchResult = function(element, offset, length, domChange
*/
WebInspector.highlightSearchResults = function(element, resultRanges, changes)
lushnikov 2014/11/07 16:27:19 This method exists by mistake, it's not general. L
aknudsen 2014/11/08 12:00:53 Acknowledged.
aknudsen 2014/11/09 00:02:14 Done.
{
- return WebInspector.highlightRangesWithStyleClass(element, resultRanges, "highlighted-search-result", changes);
+ return WebInspector.highlightRangesWithStyleClass(element, resultRanges,
+ WebInspector.highlightedSearchResultClassName, changes);
}
/**
@@ -796,7 +800,9 @@ WebInspector.highlightSearchResults = function(element, resultRanges, changes)
*/
WebInspector.removeSearchResultsHighlight = function(element)
lushnikov 2014/11/07 16:27:19 this method should accept one more argument - styl
aknudsen 2014/11/08 12:00:53 Acknowledged.
aknudsen 2014/11/09 00:02:14 Done.
{
- var highlightBits = element.querySelectorAll(".highlighted-search-result");
+ var query = "." + WebInspector.highlightedSearchResultClassName + ",." +
+ WebInspector.currentHighlightedSearchResultClassName;
+ var highlightBits = element.querySelectorAll(query);
for (var i = 0; i < highlightBits.length; ++i) {
var span = highlightBits[i];
span.parentElement.replaceChild(createTextNode(span.textContent), span);

Powered by Google App Engine
This is Rietveld 408576698