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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 2519193002: DevTools: Elements: Only lookup most used properties for properties (Closed)
Patch Set: Created 4 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
« 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: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
index 3388268d2e7f16bb7ff53c944dd0dab07658b4e8..3c3f4f09e3568b24b47c05c3eb0a412ce6f25195 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -2888,7 +2888,7 @@ Elements.StylesSidebarPane.CSSPropertyPrompt = class extends UI.TextPrompt {
var prefixResults = [];
var anywhereResults = [];
- this._cssCompletions.forEach(filterCompletions);
+ this._cssCompletions.forEach(filterCompletions.bind(this));
var results = prefixResults.concat(anywhereResults);
if (!this._isEditingName && !results.length && query.length > 1 && '!important'.startsWith(lowerQuery))
@@ -2902,13 +2902,16 @@ Elements.StylesSidebarPane.CSSPropertyPrompt = class extends UI.TextPrompt {
/**
* @param {string} completion
+ * @this {Elements.StylesSidebarPane.CSSPropertyPrompt}
*/
function filterCompletions(completion) {
var index = completion.indexOf(lowerQuery);
- if (index === 0)
- prefixResults.push({title: completion, priority: SDK.cssMetadata().propertyUsageWeight(completion)});
- else if (index > -1)
+ if (index === 0) {
+ var priority = this._isEditingName ? SDK.cssMetadata().propertyUsageWeight(completion) : 1;
+ prefixResults.push({title: completion, priority: priority});
+ } else if (index > -1) {
anywhereResults.push({title: completion});
+ }
}
}
};
« 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