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

Unified Diff: Source/devtools/front_end/components/FilterSuggestionBuilder.js

Issue 540803003: DevTools: FilterSuggestionBuilder: use case-insensitive match. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/components/FilterSuggestionBuilder.js
diff --git a/Source/devtools/front_end/components/FilterSuggestionBuilder.js b/Source/devtools/front_end/components/FilterSuggestionBuilder.js
index 4919bd1d7d3f0e23cc612ad2a993bfb80a5da175..81075b461dfab5fedd27909a26e6c82f926b6faa 100644
--- a/Source/devtools/front_end/components/FilterSuggestionBuilder.js
+++ b/Source/devtools/front_end/components/FilterSuggestionBuilder.js
@@ -64,16 +64,18 @@ WebInspector.FilterSuggestionBuilder.prototype = {
var suggestions = [];
if (valueDelimiterIndex === -1) {
+ var matcher = new RegExp("^" + prefix.escapeForRegExp(), "i");
for (var j = 0; j < this._keys.length; ++j) {
- if (this._keys[j].startsWith(prefix))
+ if (this._keys[j].match(matcher))
suggestions.push(this._keys[j] + ":");
}
} else {
var key = prefix.substring(0, valueDelimiterIndex);
var value = prefix.substring(valueDelimiterIndex + 1);
+ var matcher = new RegExp("^" + value.escapeForRegExp(), "i");
var items = this._values(key);
for (var i = 0; i < items.length; ++i) {
- if (items[i].startsWith(value) && (items[i] !== value))
+ if (items[i].match(matcher) && (items[i] !== value))
suggestions.push(key + ":" + items[i]);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698