Bug 215680

Summary: Web Inspector: Elements: Styles: grey out properties that aren't used/apply
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, hi, inspector-bugzilla-changes, nvasilyev, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 215681    
Attachments:
Description Flags
Patch
hi: commit-queue-
[Image] Screenshot of issue
none
[Image] After Patch is applied
none
Patch none

Description Devin Rousso 2020-08-19 20:03:22 PDT
IMO, the strikethrough isn't a visually obvious enough indicator that "this property is NOT being used/applied"
Comment 1 Devin Rousso 2020-08-19 20:05:13 PDT
Created attachment 406902 [details]
Patch
Comment 2 Nikita Vasilyev 2020-08-19 20:34:04 PDT
Screenshot?
Comment 3 Nikita Vasilyev 2020-08-19 20:47:36 PDT
Comment on attachment 406902 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:114
> +body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .invalid-value, .other-vendor, .overridden):not(.disabled) > .content > :matches(.name, .value-container):not(.editing),
> +body:not(.meta-key-pressed) .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .invalid-value, .other-vendor, .overridden):not(.disabled) > .content > .value-container > .value:not(.editing),
> +body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .invalid-value, .other-vendor, .overridden):not(.disabled) > .content > :matches(.name, .value-container):not(:hover, .editing),
> +body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .invalid-value, .other-vendor, .overridden):not(.disabled) > .content > .value-container > .value:not(:hover, .editing) {

That's one long selector. I see it isn't particularly new — two rules below use very similar selector.
The `body:not(.meta-key-pressed)` and `body.meta-key-pressed` gives me a pause in particular. I wonder how we can simplify it.

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:115
> +    color: hsla(0, 0%, var(--foreground-lightness), 0.6);

Any particular reason not to use `var(--text-color-secondary)`?
Comment 4 Devin Rousso 2020-08-20 12:20:32 PDT
Comment on attachment 406902 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:114
>> +body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .invalid-value, .other-vendor, .overridden):not(.disabled) > .content > .value-container > .value:not(:hover, .editing) {
> 
> That's one long selector. I see it isn't particularly new — two rules below use very similar selector.
> The `body:not(.meta-key-pressed)` and `body.meta-key-pressed` gives me a pause in particular. I wonder how we can simplify it.

`body:not(.meta-key-pressed)` includes `:hover`
`body.meta-key-pressed` excludes `:hover`

this is also "necessary" because of specificity conflicts with other rules (which possibly could be resolved using additional `:not`, but that's likely a larger change)

>> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:115
>> +    color: hsla(0, 0%, var(--foreground-lightness), 0.6);
> 
> Any particular reason not to use `var(--text-color-secondary)`?

I wanted to match the color of the strikethrough.
Comment 5 Nikita Vasilyev 2020-08-20 12:36:03 PDT
Comment on attachment 406902 [details]
Patch

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

>>> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:114
>>> +body.meta-key-pressed .spreadsheet-style-declaration-editor > .property:matches(.invalid-name, .invalid-value, .other-vendor, .overridden):not(.disabled) > .content > .value-container > .value:not(:hover, .editing) {
>> 
>> That's one long selector. I see it isn't particularly new — two rules below use very similar selector.
>> The `body:not(.meta-key-pressed)` and `body.meta-key-pressed` gives me a pause in particular. I wonder how we can simplify it.
> 
> `body:not(.meta-key-pressed)` includes `:hover`
> `body.meta-key-pressed` excludes `:hover`
> 
> this is also "necessary" because of specificity conflicts with other rules (which possibly could be resolved using additional `:not`, but that's likely a larger change)

Okay, I think it's good for now.

>>> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:115
>>> +    color: hsla(0, 0%, var(--foreground-lightness), 0.6);
>> 
>> Any particular reason not to use `var(--text-color-secondary)`?
> 
> I wanted to match the color of the strikethrough.

I think that strikethrough should also be `var(--text-color-secondary)`.
Comment 6 Devin Rousso 2020-08-20 14:18:28 PDT
Created attachment 406966 [details]
[Image] Screenshot of issue
Comment 7 Devin Rousso 2020-08-20 14:18:40 PDT
Created attachment 406967 [details]
[Image] After Patch is applied
Comment 8 Devin Rousso 2020-08-20 14:19:31 PDT
Comment on attachment 406967 [details]
[Image] After Patch is applied

Looking at this more closely, it appears that the `:` and `;` are also re-colored, which is probably not necessary.  I'll tweak the selector to not include those.
Comment 9 Devin Rousso 2020-08-23 18:17:25 PDT
Created attachment 407085 [details]
Patch
Comment 10 BJ Burg 2020-08-24 10:02:22 PDT
Comment on attachment 407085 [details]
Patch

r=me, these huge selectors make me dizzy though.
Comment 11 EWS 2020-08-24 10:11:16 PDT
Committed r266066: <https://trac.webkit.org/changeset/266066>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407085 [details].
Comment 12 Radar WebKit Bug Importer 2020-08-24 10:11:30 PDT
<rdar://problem/67685695>