Bug 168352

Summary: Web Inspector: CSS variable uses that are unresolved should have an error or warning icon
Product: WebKit Reporter: BJ Burg <bburg>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
[Image] After Patch is applied none

Description BJ 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 BJ 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.