Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Web Inspector: Assertion Failed: Expect an array of string values CSS…
…Completions.js:39 https://bugs.webkit.org/show_bug.cgi?id=240715 Reviewed by Devin Rousso. When instantiating `WI.CSSCompletions` in `WI.CSSKeywordCompletions.forFunction()` for "var" functions, the `values` array is initally empty. An array of strings was expected. 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. * Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js: Updated the assertion in the constructor to accept an empty array of values. One may be returned when requesting CSS variable name completions on a page without any variables defined. (WI.CSSCompletions.prototype.addValues): Deleted. The method can be removed because there are no other callers of `WI.CSSCompletions.addValues()`. * Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js: We can concatenate the array of pre-defined values in `WI.CSSKeywordCompletions.forFunction()` with the result of `additionalFunctionValueCompletionsProvider()` and use the result when instantiating `WI.CSSCompletions`. * Source/WebInspectorUI/UserInterface/Models/CSSPropertyNameCompletions.js: (WI.CSSPropertyNameCompletions.prototype.addValues): Deleted. It was never expected to call `WI.CSSPropertyNameCompletions.addValues()` else it would screw up the fixed list of supported property names instantiated only once when Web Inspector connects to the backend. The subclass had an assertion on `.addValues()` to remind us of this pitfall. This can go away too now. Canonical link: https://commits.webkit.org/250929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294763 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information