Bug 181145

Summary: Web Inspector: Styles: Toggle selected properties by pressing Space or Command+/
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
bburg: review+
[Animated GIF] With patch applied
none
Patch none

Description Nikita Vasilyev 2017-12-23 15:27:22 PST
Cmd+/ should comment out CSS property when focused on a property name or property value.
Cmd+/ should uncomment CSS property when it is commented out [1].

Cmd+/ should comment out all CSS properties of the rule when focused on a selector.
Cmd+/ should uncomment CSS properties if all of them are commented out.

[1]: currently there is no way to focus on the commented out property, i.e. Tab/Shift-Tab skips disabled properties.
We probably want to make <div class=property> focusable. I see this as the trickiest part of this task.
Comment 1 Radar WebKit Bug Importer 2017-12-23 15:27:37 PST
<rdar://problem/36203388>
Comment 2 Nikita Vasilyev 2018-10-31 20:29:17 PDT
When a property is selected, pressing Space should also toggle it.
Comment 3 Nikita Vasilyev 2018-10-31 23:11:57 PDT
Created attachment 353582 [details]
Patch
Comment 4 Nikita Vasilyev 2018-10-31 23:12:43 PDT
Created attachment 353583 [details]
[Animated GIF] With patch applied
Comment 5 BJ Burg 2018-11-01 09:26:32 PDT
Comment on attachment 353582 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353582&action=review

r=me

> Source/WebInspectorUI/ChangeLog:25
> +        Make `update` method public. No other chanches were made.

Nit: changes
Comment 6 Devin Rousso 2018-11-01 09:31:58 PDT
Comment on attachment 353582 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=353582&action=review

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:240
> +    get selectionRange()

Nice!

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:535
> +        } else if (event.code === "Space" || (event.key === "/" && event.metaKey)) {

Do we wan't to prevent other "special" keys as well (e.g. not while holding shift).
Comment 7 Nikita Vasilyev 2018-11-01 11:20:46 PDT
Created attachment 353622 [details]
Patch
Comment 8 WebKit Commit Bot 2018-11-01 11:57:35 PDT
Comment on attachment 353622 [details]
Patch

Clearing flags on attachment: 353622

Committed r237692: <https://trac.webkit.org/changeset/237692>
Comment 9 WebKit Commit Bot 2018-11-01 11:57:36 PDT
All reviewed patches have been landed.  Closing bug.