RESOLVED FIXED 202769
Web Inspector: Modifying CSS selector by pressing Enter or Tab causes 2 CSS.setRuleSelector backend calls
https://bugs.webkit.org/show_bug.cgi?id=202769
Summary Web Inspector: Modifying CSS selector by pressing Enter or Tab causes 2 CSS.s...
Nikita Vasilyev
Reported 2019-10-09 15:11:18 PDT
Editing a selector in the style editor causes at least two backend calls with the same data. There should be only one backend call. [Log] Trace: request (page-26) – {id: 124, method: "CSS.setRuleSelector", params: {ruleId: {styleSheetId: "1", ordinal: 1}, selector: "foo"}} changeRuleSelector (DOMNodeStyles.js:439) selectorText (CSSRule.js:76) spreadsheetSelectorFieldDidChange (SpreadsheetCSSStyleDeclarationSection.js:238) _handleKeyDown (SpreadsheetSelectorField.js:135) _handleKeyDown [Log] Trace: request (page-26) – {id: 126, method: "CSS.setRuleSelector", params: {ruleId: {styleSheetId: "1", ordinal: 1}, selector: "foo"}} changeRuleSelector (DOMNodeStyles.js:439) selectorText (CSSRule.js:76) spreadsheetSelectorFieldDidChange (SpreadsheetCSSStyleDeclarationSection.js:238) _handleBlur (SpreadsheetSelectorField.js:113) _handleBlur focus startEditing (SpreadsheetTextField.js:101) startEditingName (SpreadsheetStyleProperty.js:109) startEditingFirstProperty (SpreadsheetCSSStyleDeclarationEditor.js:258) spreadsheetSelectorFieldDidChange (SpreadsheetCSSStyleDeclarationSection.js:247) _handleKeyDown (SpreadsheetSelectorField.js:135) _handleKeyDown
Attachments
Patch (6.94 KB, patch)
2019-10-09 16:14 PDT, Nikita Vasilyev
mattbaker: review+
Patch (6.97 KB, patch)
2019-10-09 17:10 PDT, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2019-10-09 15:11:41 PDT
Nikita Vasilyev
Comment 2 2019-10-09 16:14:57 PDT
Matt Baker
Comment 3 2019-10-09 16:47:42 PDT
Comment on attachment 380583 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=380583&action=review r=me > Source/WebInspectorUI/UserInterface/Views/SpreadsheetSelectorField.js:115 > + this._delegate.spreadsheetSelectorFieldDidCommit(changed); Should we just skip calling `this._delegate.spreadsheetSelectorFieldDidCommit` altogether if !changed, instead of passing it as an argument?
Nikita Vasilyev
Comment 4 2019-10-09 17:10:36 PDT
WebKit Commit Bot
Comment 5 2019-10-09 17:55:16 PDT
Comment on attachment 380588 [details] Patch Clearing flags on attachment: 380588 Committed r250948: <https://trac.webkit.org/changeset/250948>
WebKit Commit Bot
Comment 6 2019-10-09 17:55:18 PDT
All reviewed patches have been landed. Closing bug.
Nikita Vasilyev
Comment 7 2019-10-09 21:11:36 PDT
Comment on attachment 380583 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=380583&action=review >> Source/WebInspectorUI/UserInterface/Views/SpreadsheetSelectorField.js:115 >> + this._delegate.spreadsheetSelectorFieldDidCommit(changed); > > Should we just skip calling `this._delegate.spreadsheetSelectorFieldDidCommit` altogether if !changed, instead of passing it as an argument? Turns out this wasn't such a good idea :D Bug 202781 - REGRESSION(r250948): Web Inspector: Styles: CSS selector becomes gray after stopping editing without modifying it
Note You need to log in before you can comment on or make changes to this bug.