Bug 191435

Summary: Web Inspector: Styles: Command-A should select all properties
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=190299
Bug Depends on:    
Bug Blocks: 191575    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
hi: review+
Patch none

Nikita Vasilyev
Reported 2018-11-08 13:25:06 PST
When focused on a property, Command-A should select all properties of the rule.
Attachments
Patch (1.70 KB, patch)
2018-11-08 13:26 PST, Nikita Vasilyev
no flags
Patch (3.10 KB, patch)
2018-11-08 13:55 PST, Nikita Vasilyev
no flags
Patch (4.39 KB, patch)
2018-11-09 11:27 PST, Nikita Vasilyev
no flags
Patch (4.52 KB, patch)
2018-11-12 15:28 PST, Nikita Vasilyev
no flags
Patch (4.50 KB, patch)
2018-11-12 17:29 PST, Nikita Vasilyev
hi: review+
Patch (4.48 KB, patch)
2018-11-13 10:02 PST, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2018-11-08 13:25:22 PST
Nikita Vasilyev
Comment 2 2018-11-08 13:26:16 PST
Nikita Vasilyev
Comment 3 2018-11-08 13:55:19 PST
Devin Rousso
Comment 4 2018-11-08 23:30:08 PST
Comment on attachment 354271 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354271&action=review > Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:553 > + if (!this._hasSelectedProperties() || this._propertyViews.length === 0) This makes me think that we would only respond to this event if something is selected. That doesn't make a lot of sense. I think what we want to do is bail if any property is currently being edited. > Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:557 > + this.selectProperties(0, this._propertyViews.length - 1); It looks like every call to `selectProperties` is wrapped by `_suppressBlur`. Maybe move those lines inside the function, so future callers won't need to think about that.
Nikita Vasilyev
Comment 5 2018-11-09 11:23:22 PST
Comment on attachment 354271 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354271&action=review >> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:557 >> + this.selectProperties(0, this._propertyViews.length - 1); > > It looks like every call to `selectProperties` is wrapped by `_suppressBlur`. Maybe move those lines inside the function, so future callers won't need to think about that. Good catch! One call in spreadsheetCSSStyleDeclarationEditorPropertyMouseEnter wasn't wrapped by `_suppressBlur` but it was safe to move those lines inside the function anyway.
Nikita Vasilyev
Comment 6 2018-11-09 11:27:10 PST
Created attachment 354358 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354271&action=review >> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:553 >> + if (!this._hasSelectedProperties() || this._propertyViews.length === 0) > > This makes me think that we would only respond to this event if something is selected. That doesn't make a lot of sense. I think what we want to do is bail if any property is currently being edited. I think it's fine as it is. Currently, I only want Command-A to work when at least one property is selected. Property can't be selected when I edit a name or value. I want to refactor `editing` getter because it isn't longer accurate but I don't want to do it in this patch.
Nikita Vasilyev
Comment 7 2018-11-12 15:28:23 PST
Created attachment 354599 [details] Patch I created "Bug 191567 - Web Inspector: Styles: SpreadsheetCSSStyleDeclarationEditor.prototype.editing getter is inaccurate", and I left a comment in the code. I have a plan for refactoring, but it may break things and I'd hate to introduce a regression in the current style editor while working on the experimental feature.
Nikita Vasilyev
Comment 8 2018-11-12 17:29:52 PST
Devin Rousso
Comment 9 2018-11-13 09:32:47 PST
Comment on attachment 354612 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354612&action=review r=me, nice refactoring :) > Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:559 > + if (!this._hasSelectedProperties() || this._propertyViews.length === 0) Style: `!this._propertyViews.length`
Nikita Vasilyev
Comment 10 2018-11-13 10:02:35 PST
WebKit Commit Bot
Comment 11 2018-11-13 10:40:08 PST
Comment on attachment 354678 [details] Patch Clearing flags on attachment: 354678 Committed r238135: <https://trac.webkit.org/changeset/238135>
WebKit Commit Bot
Comment 12 2018-11-13 10:40:09 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.