Bug 168352 - Web Inspector: CSS variable uses that are unresolved should have an error or warning icon
Summary: Web Inspector: CSS variable uses that are unresolved should have an error or ...
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: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-02-14 20:02 PST by Brian Burg
Modified: 2017-02-28 15:35 PST (History)
6 users (show)

See Also:


Attachments
Patch (4.69 KB, patch)
2017-02-27 16:13 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
[Image] After Patch is applied (78.71 KB, image/png)
2017-02-27 16:14 PST, Devin Rousso
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2017-02-14 20:02:25 PST
We don't show anything special when using var(--does-not-exist). We should strike out the variable or add an icon, and say what value is actually being used instead.
Comment 1 Radar WebKit Bug Importer 2017-02-14 20:03:11 PST
<rdar://problem/30527478>
Comment 2 Devin Rousso 2017-02-27 16:13:38 PST
Created attachment 302884 [details]
Patch
Comment 3 Devin Rousso 2017-02-27 16:14:00 PST
Created attachment 302885 [details]
[Image] After Patch is applied
Comment 4 Brian Burg 2017-02-27 21:38:22 PST
Comment on attachment 302884 [details]
Patch

This is awesome. Will review in the morning.
Comment 5 Joseph Pecoraro 2017-02-28 12:12:08 PST
Yes, very neat!

The only thing that is weird to me is "Click to delete and open autocomplete". Click to delete I get. The open autocomplete part seems weird.
Comment 6 Matt Baker 2017-02-28 12:27:31 PST
(In reply to comment #5)
> Yes, very neat!
> 
> The only thing that is weird to me is "Click to delete and open
> autocomplete". Click to delete I get. The open autocomplete part seems weird.

I had the same initial reaction. Note that we also do this for invalid property values:

"The value “%s” is not supported for this property.\nClick to delete and open autocomplete."
Comment 7 Devin Rousso 2017-02-28 13:49:34 PST
(In reply to comment #6)
> (In reply to comment #5)
> > Yes, very neat!
> > 
> > The only thing that is weird to me is "Click to delete and open
> > autocomplete". Click to delete I get. The open autocomplete part seems weird.
> 
> I had the same initial reaction. Note that we also do this for invalid
> property values:
> 
> "The value “%s” is not supported for this property.\nClick to delete and
> open autocomplete."

Exactly.  I was thinking that in the case where the text was `margin: 10px var(--x) 5px;` the user wouldn't want the resulting text after click to be `margin: 10px 5px;`.  I realize that this is what happens in actuality, but opening autocomplete suggests to the user that they replace the value with something valid instead of just getting rid of it.
Comment 8 WebKit Commit Bot 2017-02-28 15:35:48 PST
Comment on attachment 302884 [details]
Patch

Clearing flags on attachment: 302884

Committed r213187: <http://trac.webkit.org/changeset/213187>
Comment 9 WebKit Commit Bot 2017-02-28 15:35:53 PST
All reviewed patches have been landed.  Closing bug.