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

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

Issue 2681043002: DevTools: Combine TextPrompt events into UI.TextPrompt.TextChangedEvent (Closed)
Patch Set: leave comment Created 3 years, 10 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 | third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js » ('j') | 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 82a5a0d13020d309c300c25eebf544e17231b7ba..9325f062ba194ca295ac7da8407b8918ee9017d0 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -2344,7 +2344,6 @@ Elements.StylePropertyTreeElement = class extends UI.TreeElement {
if (selectElement.parentElement)
selectElement.parentElement.scrollIntoViewIfNeeded(false);
- var applyItemCallback = !isEditingName ? this._applyFreeFlowStyleTextEdit.bind(this) : undefined;
var cssCompletions = [];
if (isEditingName) {
cssCompletions = SDK.cssMetadata().allProperties();
@@ -2357,16 +2356,16 @@ Elements.StylePropertyTreeElement = class extends UI.TreeElement {
this._prompt = new Elements.StylesSidebarPane.CSSPropertyPrompt(cssCompletions, cssVariables, this, isEditingName);
this._prompt.setAutocompletionTimeout(0);
- if (applyItemCallback) {
- this._prompt.addEventListener(UI.TextPrompt.Events.ItemApplied, applyItemCallback, this);
- this._prompt.addEventListener(UI.TextPrompt.Events.ItemAccepted, applyItemCallback, this);
- }
+
+ // Do not live-edit "content" property of pseudo elements. crbug.com/433889
+ if (!isEditingName && (!this._parentPane.node().pseudoType() || this.name !== 'content'))
+ this._prompt.on(UI.TextPrompt.TextChangedEvent, this._applyFreeFlowStyleTextEdit.bind(this));
+
var proxyElement = this._prompt.attachAndStartEditing(selectElement, blurListener.bind(this, context));
this._navigateToSource(selectElement, true);
proxyElement.addEventListener('keydown', this._editingNameValueKeyDown.bind(this, context), false);
proxyElement.addEventListener('keypress', this._editingNameValueKeyPress.bind(this, context), false);
- proxyElement.addEventListener('input', this._editingNameValueInput.bind(this, context), false);
if (isEditingName)
proxyElement.addEventListener('paste', pasteHandler.bind(this, context), false);
@@ -2455,16 +2454,6 @@ Elements.StylePropertyTreeElement = class extends UI.TreeElement {
}
}
- /**
- * @param {!Elements.StylePropertyTreeElement.Context} context
- * @param {!Event} event
- */
- _editingNameValueInput(context, event) {
- // Do not live-edit "content" property of pseudo elements. crbug.com/433889
- if (!context.isEditingName && (!this._parentPane.node().pseudoType() || this.name !== 'content'))
- this._applyFreeFlowStyleTextEdit();
- }
-
_applyFreeFlowStyleTextEdit() {
var valueText = this._prompt.textWithCurrentSuggestion();
if (valueText.indexOf(';') === -1)
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698