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

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

Issue 2571713002: DevTools: [SSP] do not autocomplete SVG properties for non-svg nodes (Closed)
Patch Set: addres comments Created 4 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: 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 628d1132a9fd9c242f2b67decac22d3068b02c21..d5f2731b0a6fe836a1d97d1d0ba34c9eb6640a9f 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -2321,8 +2321,15 @@ Elements.StylePropertyTreeElement = class extends TreeElement {
selectElement.parentElement.scrollIntoViewIfNeeded(false);
var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdit.bind(this) : undefined;
- var cssCompletions = isEditingName ? SDK.cssMetadata().allProperties() :
- SDK.cssMetadata().propertyValues(this.nameElement.textContent);
+ var cssCompletions = [];
+ if (isEditingName) {
+ cssCompletions = SDK.cssMetadata().allProperties();
+ cssCompletions =
+ cssCompletions.filter(property => SDK.cssMetadata().isSVGProperty(property) === this.node().isSVGNode());
PhistucK 2016/12/13 08:43:51 Ouch! This seems very unnecessarily unfriendly to
+ } else {
+ cssCompletions = SDK.cssMetadata().propertyValues(this.nameElement.textContent);
+ }
+
this._prompt = new Elements.StylesSidebarPane.CSSPropertyPrompt(cssCompletions, this, isEditingName);
this._prompt.setAutocompletionTimeout(0);
if (applyItemCallback) {

Powered by Google App Engine
This is Rietveld 408576698