Bug 154441

Summary: Web Inspector: Implement autocompletion for CSS variables
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Image] Mockup
none
Patch
joepeck: review+
[Image] After Patch is applied
none
Patch none

Description Nikita Vasilyev 2016-02-18 23:37:21 PST
Created attachment 271738 [details]
[Image] Mockup

It would be nice to show an autocomplete pop-over for CSS variables.

Neither Chrome DevTools nor Firefox DevTools has it yet.
Comment 1 Radar WebKit Bug Importer 2016-02-18 23:37:56 PST
<rdar://problem/24737257>
Comment 2 Devin Rousso 2017-04-12 14:29:25 PDT
Created attachment 306936 [details]
Patch
Comment 3 Devin Rousso 2017-04-12 14:29:49 PDT
Created attachment 306937 [details]
[Image] After Patch is applied
Comment 4 Joseph Pecoraro 2017-04-13 20:30:16 PDT
Comment on attachment 306936 [details]
Patch

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

r=me

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:392
> +        let variables = properties.filter((property) => /--[\w-]+/.test(property.name) && property.name.startsWith(prefix));

We already have `property.variable` which would let us drop this RegExp match (which looks unnecessarily complex):

    let variables = properties.filter((property) => property.variable && property.name.startsWith(prefix));
Comment 5 Devin Rousso 2017-04-13 23:23:56 PDT
Created attachment 307096 [details]
Patch
Comment 6 WebKit Commit Bot 2017-04-13 23:51:55 PDT
Comment on attachment 307096 [details]
Patch

Clearing flags on attachment: 307096

Committed r215358: <http://trac.webkit.org/changeset/215358>
Comment 7 WebKit Commit Bot 2017-04-13 23:51:56 PDT
All reviewed patches have been landed.  Closing bug.