WebKit Bugzilla
Attachment 356667 Details for
Bug 191567
: Web Inspector: Styles: SpreadsheetCSSStyleDeclarationEditor.prototype.editing getter is inaccurate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
WIP.txt (text/plain), 5.61 KB, created by
Nikita Vasilyev
on 2018-12-05 15:18:28 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2018-12-05 15:18:28 PST
Size:
5.61 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >index a21e7d4f5d9..3107ce41fd6 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >@@ -35,8 +35,8 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > this.style = style; > this._propertyViews = []; > >- this._focused = false; > this._inlineSwatchActive = false; >+ this._editingProperty = false; > > this._showsImplicitProperties = false; > this._alwaysShowPropertyNames = new Set; >@@ -59,15 +59,6 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > if (!this._style) > return; > >- this.element.addEventListener("focus", () => { this.focused = true; }, true); >- this.element.addEventListener("blur", (event) => { >- let focusedElement = event.relatedTarget; >- if (focusedElement && this.element.contains(focusedElement)) >- return; >- >- this.focused = false; >- }, true); >- > this.element.addEventListener("keydown", this._handleKeyDown.bind(this)); > } > >@@ -119,7 +110,6 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > detached() > { > this._inlineSwatchActive = false; >- this.focused = false; > > for (let propertyView of this._propertyViews) > propertyView.detached(); >@@ -154,13 +144,7 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > > get editing() > { >- return this._focused || this._inlineSwatchActive; >- } >- >- set focused(value) >- { >- this._focused = value; >- this._updateStyleLock(); >+ return this._editingProperty || this._inlineSwatchActive || this.hasSelectedProperties(); > } > > set inlineSwatchActive(value) >@@ -360,7 +344,6 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > for (let propertyView of this._propertyViews) > propertyView.selected = false; > >- this._focused = false; > this._anchorIndex = NaN; > this._focusIndex = NaN; > } >@@ -388,6 +371,18 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > > // SpreadsheetStyleProperty delegate > >+ spreadsheetStylePropertyDidStartEditing(property) >+ { >+ this._editingProperty = true; >+ this._updateStyleLock(); >+ } >+ >+ spreadsheetStylePropertyDidStopEditing(property) >+ { >+ this._editingProperty = false; >+ this._updateStyleLock(); >+ } >+ > spreadsheetStylePropertyBlur(event, property) > { > if (this._suppressBlur) >@@ -479,8 +474,6 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > > for (let index = 0; index < this._propertyViews.length; index++) > this._propertyViews[index].index = index; >- >- this._focused = false; > } > > spreadsheetStylePropertyShowProperty(propertyView, property) >@@ -611,7 +604,7 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > if (!this._style) > return; > >- this._style.locked = this._focused || this._inlineSwatchActive; >+ this._style.locked = this.editing; > this._updateDebugLockStatus(); > } > >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >index ef68b658e9f..d26039756e8 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >@@ -320,6 +320,18 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object > textField.value = isEditingName ? this._property.name : this._property.rawValue; > } > >+ spreadsheetTextFieldDidStartEditing(textField) >+ { >+ if (typeof this._delegate.spreadsheetStylePropertyDidStartEditing === "function") >+ this._delegate.spreadsheetStylePropertyDidStartEditing(); >+ } >+ >+ spreadsheetTextFieldDidStopEditing(textField) >+ { >+ if (typeof this._delegate.spreadsheetStylePropertyDidStopEditing === "function") >+ this._delegate.spreadsheetStylePropertyDidStopEditing(); >+ } >+ > spreadsheetTextFieldDidChange(textField) > { > if (textField === this._valueTextField) >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >index 02b74bd84fe..d659b970b96 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetTextField.js >@@ -101,6 +101,9 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > this._selectText(); > > this._updateCompletions(); >+ >+ if (this._delegate && typeof this._delegate.spreadsheetTextFieldDidStartEditing === "function") >+ this._delegate.spreadsheetTextFieldDidStartEditing(this); > } > > stopEditing() >@@ -114,6 +117,9 @@ WI.SpreadsheetTextField = class SpreadsheetTextField > this._element.contentEditable = false; > > this.discardCompletion(); >+ >+ if (this._delegate && typeof this._delegate.spreadsheetTextFieldDidStopEditing === "function") >+ this._delegate.spreadsheetTextFieldDidStopEditing(this); > } > > discardCompletion()
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
Flags:
nvasilyev
:
review-
nvasilyev
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191567
:
354969
| 356667 |
356668