Bug 154441 - Web Inspector: Implement autocompletion for CSS variables
Summary: Web Inspector: Implement autocompletion for CSS variables
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: 2016-02-18 23:37 PST by Nikita Vasilyev
Modified: 2017-04-13 23:51 PDT (History)
5 users (show)

See Also:


Attachments
[Image] Mockup (48.96 KB, image/png)
2016-02-18 23:37 PST, Nikita Vasilyev
no flags Details
Patch (1.99 KB, patch)
2017-04-12 14:29 PDT, Devin Rousso
joepeck: review+
Details | Formatted Diff | Diff
[Image] After Patch is applied (41.08 KB, image/png)
2017-04-12 14:29 PDT, Devin Rousso
no flags Details
Patch (1.88 KB, patch)
2017-04-13 23:23 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.