Bug 132090 - Web Inspector: CSS autofill suggests properties instead of values when values are needed
Summary: Web Inspector: CSS autofill suggests properties instead of values when values...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-04-23 16:34 PDT by Jonathan Wells
Modified: 2014-04-24 17:34 PDT (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix: Updated to CSS mode handling to fix autocomplete, other issues (34.82 KB, patch)
2014-04-24 14:50 PDT, Jonathan Wells
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wells 2014-04-23 16:34:39 PDT
In the styles sidebar, property names are suggested in place of values. For instance, 'display: b' should suggest 'block' but instead 'background' and other possible property names appear.
Comment 1 Radar WebKit Bug Importer 2014-04-23 16:35:55 PDT
<rdar://problem/16706366>
Comment 2 Jonathan Wells 2014-04-24 14:50:14 PDT
Created attachment 230108 [details]
[PATCH] Proposed Fix: Updated to CSS mode handling to fix autocomplete, other issues
Comment 3 Joseph Pecoraro 2014-04-24 14:59:30 PDT
Comment on attachment 230108 [details]
[PATCH] Proposed Fix: Updated to CSS mode handling to fix autocomplete, other issues

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

r=me

> Source/WebInspectorUI/ChangeLog:13
> +        data structure. All references to state.stack are obscelete. Many

Typo: obscelete

> Source/WebInspectorUI/ChangeLog:884
> -        Add missing semicolon.        
> +        Add missing semicolon.

I wonder if commit queue will allow a patch that fixes this trailing whitespace. Maybe it will, maybe it won't.

> Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js:398
> +        if (!state.stack || !state.stack.length || state.stack.lastValue === "@media{")

These only fix the exception, but I assume they don't make CSS pretty printing work?
Comment 4 Jonathan Wells 2014-04-24 15:20:37 PDT
That's right, this just fixes the exception.  See https://bugs.webkit.org/show_bug.cgi?id=132149
Comment 5 Jonathan Wells 2014-04-24 15:22:17 PDT
Good question re: the whitespace. I meant to remove that and did so incorrectly. That should be done in a separate patch probably.
Comment 6 WebKit Commit Bot 2014-04-24 15:29:44 PDT
Comment on attachment 230108 [details]
[PATCH] Proposed Fix: Updated to CSS mode handling to fix autocomplete, other issues

Clearing flags on attachment: 230108

Committed r167779: <http://trac.webkit.org/changeset/167779>
Comment 7 WebKit Commit Bot 2014-04-24 15:29:47 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Timothy Hatcher 2014-04-24 17:01:13 PDT
Comment on attachment 230108 [details]
[PATCH] Proposed Fix: Updated to CSS mode handling to fix autocomplete, other issues

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

> Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js:523
> +        if (!mainToken.state || !mainToken.state.state || !mainToken.state.state === "block")
>              return [];

This is not right. The while loop later looks for "prop", but this returns early if there is no "block" state. This needs to do a similar contains check up the state stack for "block".

As-is only proper name completions will work, property value completions will not work. But maybe you intended to fix this in the other bug.
Comment 9 Jonathan Wells 2014-04-24 17:34:26 PDT
Yes, this was just a quick fix to avoid total breakage of the inspector. Plan to rework in https://bugs.webkit.org/show_bug.cgi?id=132149