| Summary: | Web Inspector: Assertion Failed: Expect an array of string values CSSCompletions.js:39 | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Razvan Caliman <rcaliman> |
| Component: | Web Inspector | Assignee: | Razvan Caliman <rcaliman> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | inspector-bugzilla-changes, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | All | ||
| OS: | All | ||
Pull request: https://github.com/WebKit/WebKit/pull/831 Committed r294763 (250929@main): <https://commits.webkit.org/250929@main> Reviewed commits have been landed. Closing PR #831 and removing active labels. |
``` [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 "var" 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's no reason to have this two step approach. We can provide the result of `additionalFunctionValueCompletionsProvider("var")` at `WI.CSSCompletions` instantiation.