Bug 194967 - Web Inspector: Styles: Command-/ should toggle edited property
Summary: Web Inspector: Styles: Command-/ should toggle edited property
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
Keywords: InRadar
Depends on:
Reported: 2019-02-22 16:48 PST by Nikita Vasilyev
Modified: 2019-02-25 17:50 PST (History)
4 users (show)

See Also:

Patch (3.54 KB, patch)
2019-02-23 16:09 PST, Nikita Vasilyev
drousso: review+
Details | Formatted Diff | Diff
[Video] With patch applied (726.61 KB, video/quicktime)
2019-02-23 16:15 PST, Nikita Vasilyev
no flags Details
Patch for landing (4.29 KB, patch)
2019-02-25 17:13 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 2019-02-22 16:48:30 PST
Pressing Command-/ toggles *selected* CSS property.
Bug 181145 - Web Inspector: Styles: Toggle selected properties by pressing Space or Command+/

It should also work when editing CSS property name or value.

1. Inspect <body> on webkit.org
2. Click on "font-size" (or it's value)
3. Press Command-/ (Ctrl-/ on non-Mac)

"font-size" is commented out.
font-size *property* is now selected - we need to select the property so consequent Command-/ would uncomment it.

Nothing happens.
Comment 1 Radar WebKit Bug Importer 2019-02-22 16:49:39 PST
Comment 2 Nikita Vasilyev 2019-02-23 16:09:48 PST
Created attachment 362839 [details]
Comment 3 Nikita Vasilyev 2019-02-23 16:15:15 PST
Created attachment 362840 [details]
[Video] With patch applied
Comment 4 Devin Rousso 2019-02-25 13:52:45 PST
Comment on attachment 362839 [details]

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


Probably unrelated, but when I select multiple properties and press ⌘/, I hit an assertion failure.

    Models/CSSProperty.js:146:23: CONSOLE ERROR CSS property is already disabled

We should probably just remove that assertion.

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:164
> +                this._toggle();

NIT: we should assert (or even just set it) that the checkbox's state matches the property's `enabled`.

    console.assert(this._checkboxElement.checked === this.property.enabled);

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:423
> +            const index = parseInt(this._element.dataset.propertyIndex);

Style: this should be `let`.
Comment 5 Nikita Vasilyev 2019-02-25 17:13:33 PST
Created attachment 362944 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2019-02-25 17:50:51 PST
Comment on attachment 362944 [details]
Patch for landing

Clearing flags on attachment: 362944

Committed r242063: <https://trac.webkit.org/changeset/242063>
Comment 7 WebKit Commit Bot 2019-02-25 17:50:52 PST
All reviewed patches have been landed.  Closing bug.