WebKit Bugzilla
Attachment 357901 Details for
Bug 192919
: Web Inspector: Styles: Pressing Esc when editing name/value should select entire property
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 4.81 KB, created by
Nikita Vasilyev
on 2018-12-20 16:57:52 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2018-12-20 16:57:52 PST
Size:
4.81 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 7b97204a245..9c5f1f09a3d 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,25 @@ >+2018-12-20 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ Web Inspector: Styles: Pressing Esc when editing name/value should select entire property >+ https://bugs.webkit.org/show_bug.cgi?id=192919 >+ >+ Reviewed by Devin Rousso. >+ >+ - Esc still hides the completion popover. >+ - Esc still discards changes. >+ - When there's no completion popover, Esc selects outer scope. >+ I.e., it goes from editing name/value to selecting the entire property. >+ - Pressing Esc for newly added properties discards those properties. >+ >+ * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: >+ (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): >+ (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyDidPressEsc): >+ * UserInterface/Views/SpreadsheetStyleProperty.js: >+ (WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidPressEsc): >+ * UserInterface/Views/SpreadsheetTextField.js: >+ (WI.SpreadsheetTextField.prototype._discardChange): >+ (WI.SpreadsheetTextField.prototype._handleKeyDown): >+ > 2018-12-19 Matt Baker <mattbaker@apple.com> > > Web Inspector: Elements tab: arrow key after undoing a DOM node delete selects the wrong element >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >index a21e7d4f5d9..e6cdb9013d8 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >@@ -480,7 +480,7 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > for (let index = 0; index < this._propertyViews.length; index++) > this._propertyViews[index].index = index; > >- this._focused = false; >+ this.focused = false; > } > > spreadsheetStylePropertyShowProperty(propertyView, property) >@@ -489,6 +489,14 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > this._delegate.spreadsheetCSSStyleDeclarationEditorShowProperty(this, property); > } > >+ spreadsheetStylePropertyDidPressEsc(propertyView) >+ { >+ let index = this._propertyViews.indexOf(propertyView); >+ console.assert(index !== -1, `Can't find StyleProperty to select (${propertyView.property.name})`); >+ if (index !== -1) >+ this.selectProperties(index, index); >+ } >+ > stylePropertyInlineSwatchActivated() > { > this.inlineSwatchActive = true; >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >index 349cbd2c0af..c819771d320 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >@@ -391,6 +391,15 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object > this._nameTextField.startEditing(); > } > >+ spreadsheetTextFieldDidPressEsc(textField, textBeforeEditing) >+ { >+ let isNewProperty = !textBeforeEditing; >+ if (isNewProperty) >+ this.remove(); >+ else if (this._delegate.spreadsheetStylePropertyDidPressEsc) >+ this._delegate.spreadsheetStylePropertyDidPressEsc(this); >+ } >+ > // Private > > _isEditable() >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >index 02b74bd84fe..40d35b4e910 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >@@ -191,7 +191,6 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > { > if (this._valueBeforeEditing !== this.value) { > this.value = this._valueBeforeEditing; >- this._selectText(); > > if (this._delegate && typeof this._delegate.spreadsheetTextFieldDidChange === "function") > this._delegate.spreadsheetTextFieldDidChange(this); >@@ -282,6 +281,10 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > if (event.key === "Escape") { > event.stop(); > this._discardChange(); >+ window.getSelection().removeAllRanges(); >+ >+ if (this._delegate && this._delegate.spreadsheetTextFieldDidPressEsc) >+ this._delegate.spreadsheetTextFieldDidPressEsc(this, this._valueBeforeEditing); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192919
:
357866
|
357867
| 357901