Bug 177461 - Web Inspector: Styles Redesign: Style unused, overridden, and invalid properties differently
Summary: Web Inspector: Styles Redesign: Style unused, overridden, and invalid propert...
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-09-25 13:45 PDT by Nikita Vasilyev
Modified: 2017-09-30 14:58 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.89 KB, patch)
2017-09-25 13:59 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Patch (4.89 KB, patch)
2017-09-25 14:25 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
[Screenshot] With patch applied (128.43 KB, image/png)
2017-09-25 14:36 PDT, Nikita Vasilyev
no flags Details
Patch (4.92 KB, patch)
2017-09-26 16:43 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Patch (4.95 KB, patch)
2017-09-26 16:47 PDT, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
[Screenshot] With patch applied (127.71 KB, image/png)
2017-09-26 16:49 PDT, Nikita Vasilyev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2017-09-25 13:45:02 PDT
Style unused, overridden, invalid, and not-inherited properties the same way as in the current styles sidebar.

<rdar://problem/33525629>
Comment 1 Nikita Vasilyev 2017-09-25 13:59:09 PDT
Created attachment 321737 [details]
Patch
Comment 2 Nikita Vasilyev 2017-09-25 14:06:09 PDT
Comment on attachment 321737 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:75
> +.spreadsheet-style-declaration-editor .property:matches(.invalid, .other-vendor, .not-inherited, .overridden) {
> +    text-decoration: line-through;
> +    -webkit-text-decoration-color: hsla(0, 0%, 0%, 0.6);
> +}
> +
> +.spreadsheet-style-declaration-editor .property.invalid {
> +    -webkit-text-decoration-color: hsla(0, 100%, 50%, 0.6);
> +}

This is the same line-through as in https://github.com/WebKit/webkit/blob/bc1e9d2e86be469e2a519c15c8368ca043623f03/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css#L66-L76

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:79
> +}

Same opacity as in https://github.com/WebKit/webkit/blob/bc1e9d2e86be469e2a519c15c8368ca043623f03/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.css#L95-L97.

> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:141
> +        this._element.classList.add(...classNames);

This is a copy/paste of https://github.com/WebKit/webkit/blob/bc1e9d2e86be469e2a519c15c8368ca043623f03/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js#L1016-L1051

However, I moved propertyNameIsValid inside of the relevant if condition, and replaced `var` with `let`.
Comment 3 Nikita Vasilyev 2017-09-25 14:25:39 PDT
Created attachment 321741 [details]
Patch
Comment 4 Nikita Vasilyev 2017-09-25 14:36:31 PDT
Created attachment 321744 [details]
[Screenshot] With patch applied

Static page for manual testing: http://nv.github.io/webkit-inspector-bugs/styles-redesign/tests/property-types.html
Comment 5 Nikita Vasilyev 2017-09-26 16:43:30 PDT
Created attachment 321892 [details]
Patch
Comment 6 Nikita Vasilyev 2017-09-26 16:47:23 PDT
Created attachment 321895 [details]
Patch
Comment 7 Nikita Vasilyev 2017-09-26 16:49:14 PDT
Created attachment 321896 [details]
[Screenshot] With patch applied
Comment 8 Matt Baker 2017-09-26 19:23:45 PDT
Comment on attachment 321895 [details]
Patch

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

r=me

> Source/WebInspectorUI/ChangeLog:10
> +        - Non-inherited properties of inherited rules are no longer strikethrough (but still semi-transparent).

Those strikethroughs were confusing. Looks like we match Chrome now. I noticed both Firefox and Edge hide non-inherited properties completely.
Comment 9 WebKit Commit Bot 2017-09-26 19:54:39 PDT
Comment on attachment 321895 [details]
Patch

Clearing flags on attachment: 321895

Committed r222547: <http://trac.webkit.org/changeset/222547>
Comment 10 WebKit Commit Bot 2017-09-26 19:54:40 PDT
All reviewed patches have been landed.  Closing bug.