<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>240715</bug_id>
          
          <creation_ts>2022-05-20 07:28:23 -0700</creation_ts>
          <short_desc>Web Inspector: Assertion Failed: Expect an array of string values CSSCompletions.js:39</short_desc>
          <delta_ts>2022-05-24 13:55:37 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Razvan Caliman">rcaliman</reporter>
          <assigned_to name="Razvan Caliman">rcaliman</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1870703</commentid>
    <comment_count>0</comment_count>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2022-05-20 07:28:23 -0700</bug_when>
    <thetext>```
[Error] Assertion Failed: Expect an array of string values – [] (0)
    CSSCompletions (CSSCompletions.js:39)
    (anonymous function) (CSSKeywordCompletions.js:233)
    (anonymous function) (CSSKeywordCompletions.js:129)
    _valueCompletionDataProvider
    _updateCompletions (SpreadsheetTextField.js:435)
    _handleInput (SpreadsheetTextField.js:422)
    _handleInput
```

**Steps to reproduce**

- Open Web Inspector, go to Styles sidebar panel
- Type `var(` on any CSS value

**Result**

No issue in UI or UX, but the assertion above is hit.


**Explanation**

It happens because the `WI.CSSCompletions` instance created in `WI.CSSKeywordCompletions.forFunction()` is initially given an empty array for &quot;var&quot; functions. The actual values are added immediately after instantiation via `WI.CSSCompletions.addValues()`. They come from the custom completion provider referenced by the `additionalFunctionValueCompletionsProvider` option.

There&apos;s no reason to have this two step approach. We can provide the result of `additionalFunctionValueCompletionsProvider(&quot;var&quot;)` at `WI.CSSCompletions` instantiation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870704</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-05-20 07:29:02 -0700</bug_when>
    <thetext>&lt;rdar://problem/93653315&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1870712</commentid>
    <comment_count>2</comment_count>
    <who name="Razvan Caliman">rcaliman</who>
    <bug_when>2022-05-20 07:50:00 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/831</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1871563</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-05-24 13:55:35 -0700</bug_when>
    <thetext>Committed r294763 (250929@main): &lt;https://commits.webkit.org/250929@main&gt;

Reviewed commits have been landed. Closing PR #831 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>