Bug 194967

Summary: Web Inspector: Styles: Command-/ should toggle edited property
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Severity: Normal CC: commit-queue, drousso, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Description Flags
drousso: review+
[Video] With patch applied
Patch for landing none

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.