Bug 181145 - Web Inspector: Styles: Toggle selected properties by pressing Space or Command+/
Summary: Web Inspector: Styles: Toggle selected properties by pressing Space or Command+/
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:
 
Reported: 2017-12-23 15:27 PST by Nikita Vasilyev
Modified: 2018-11-01 11:57 PDT (History)
5 users (show)

See Also:


Attachments
Patch (12.29 KB, patch)
2018-10-31 23:11 PDT, Nikita Vasilyev
bburg: review+
Details | Formatted Diff | Diff
[Animated GIF] With patch applied (59.01 KB, image/gif)
2018-10-31 23:12 PDT, Nikita Vasilyev
no flags Details
Patch (12.38 KB, patch)
2018-11-01 11:20 PDT, 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 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.