WebKit Bugzilla
Attachment 372734 Details for
Bug 199143
: REGRESSION(r246621): Web Inspector: Styles: property may get removed when editing after deleting value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 3.75 KB, created by
Nikita Vasilyev
on 2019-06-23 23:45:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2019-06-23 23:45:23 PDT
Size:
3.75 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 171555d220c..c336b3ccfca 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,26 @@ >+2019-06-23 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ REGRESSION(r246621): Web Inspector: Styles: property may get removed when editing after deleting value >+ https://bugs.webkit.org/show_bug.cgi?id=199143 >+ <rdar://problem/52042815> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ r246621 affected when WI.CSSStyleDeclaration.Event.PropertiesChanged event is fired, which caused >+ SpreadsheetCSSStyleDeclarationEditor to possibly enter a state when `focused` property is >+ incorrectly set to false. >+ >+ * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: >+ (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): Removed. >+ (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyWillRemove): Added. >+ Renamed from "removed" to "willRemove" since we need to call it before the property DOM element >+ is detached from the document. >+ >+ * UserInterface/Views/SpreadsheetStyleProperty.js: >+ (WI.SpreadsheetStyleProperty.prototype.remove): >+ Don't set focused to false when the removed property wasn't focused. >+ This code need to exist because removing focused element from the DOM doesn't trigger blur event. >+ > 2019-06-22 Nikita Vasilyev <nvasilyev@apple.com> > > REGRESSION(r241980): Web Inspector: Styles: Pressing Tab/Enter on last property no longer focuses on selector on next rule >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >index e82da88c485..cb93cae59f3 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js >@@ -487,14 +487,16 @@ WI.SpreadsheetCSSStyleDeclarationEditor = class SpreadsheetCSSStyleDeclarationEd > event.stop(); > } > >- spreadsheetStylePropertyRemoved(propertyView) >+ spreadsheetStylePropertyWillRemove(propertyView) > { > this._propertyViews.remove(propertyView); > > for (let index = 0; index < this._propertyViews.length; index++) > this._propertyViews[index].index = index; > >- this.focused = false; >+ let wasFocused = document.activeElement && propertyView.element.contains(document.activeElement); >+ if (wasFocused) >+ this.focused = false; > } > > spreadsheetStylePropertyShowProperty(propertyView, property) >diff --git a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >index 7f593231a28..68b77b2ee9c 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js >@@ -138,6 +138,9 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object > > remove(replacement = null) > { >+ if (this._delegate && typeof this._delegate.spreadsheetStylePropertyWillRemove === "function") >+ this._delegate.spreadsheetStylePropertyWillRemove(this); >+ > this.element.remove(); > > if (replacement) >@@ -146,9 +149,6 @@ WI.SpreadsheetStyleProperty = class SpreadsheetStyleProperty extends WI.Object > this._property.remove(); > > this.detached(); >- >- if (this._delegate && typeof this._delegate.spreadsheetStylePropertyRemoved === "function") >- this._delegate.spreadsheetStylePropertyRemoved(this); > } > > update()
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 199143
:
372732
| 372734 |
372736