Bug 191435 - Web Inspector: Styles: Command-A should select all properties
Summary: Web Inspector: Styles: Command-A should select all properties
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks: 191575
  Show dependency treegraph
 
Reported: 2018-11-08 13:25 PST by Nikita Vasilyev
Modified: 2018-11-13 10:40 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.70 KB, patch)
2018-11-08 13:26 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Patch (3.10 KB, patch)
2018-11-08 13:55 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Patch (4.39 KB, patch)
2018-11-09 11:27 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Patch (4.52 KB, patch)
2018-11-12 15:28 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Patch (4.50 KB, patch)
2018-11-12 17:29 PST, Nikita Vasilyev
hi: review+
Details | Formatted Diff | Diff
Patch (4.48 KB, patch)
2018-11-13 10:02 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2018-11-08 13:25:06 PST
When focused on a property, Command-A should select all properties of the rule.
Comment 1 Radar WebKit Bug Importer 2018-11-08 13:25:22 PST
<rdar://problem/45921373>
Comment 2 Nikita Vasilyev 2018-11-08 13:26:16 PST
Created attachment 354267 [details]
Patch
Comment 3 Nikita Vasilyev 2018-11-08 13:55:19 PST
Created attachment 354271 [details]
Patch
Comment 4 Devin Rousso 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.
Comment 5 Nikita Vasilyev 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.
Comment 6 Nikita Vasilyev 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.
Comment 7 Nikita Vasilyev 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.
Comment 8 Nikita Vasilyev 2018-11-12 17:29:52 PST
Created attachment 354612 [details]
Patch
Comment 9 Devin Rousso 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`
Comment 10 Nikita Vasilyev 2018-11-13 10:02:35 PST
Created attachment 354678 [details]
Patch
Comment 11 WebKit Commit Bot 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>
Comment 12 WebKit Commit Bot 2018-11-13 10:40:09 PST
All reviewed patches have been landed.  Closing bug.