Bug 230153 - Web Inspector: Update naming of WI.CSSCompletions callback used for collecting supported CSS properties from the target
Summary: Web Inspector: Update naming of WI.CSSCompletions callback used for collectin...
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: Razvan Caliman
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-10 08:27 PDT by Razvan Caliman
Modified: 2021-09-13 14:41 PDT (History)
5 users (show)

See Also:


Attachments
Patch 1.0 (3.23 KB, patch)
2021-09-10 08:35 PDT, Razvan Caliman
no flags Details | Formatted Diff | Diff
Patch 1.1 (3.24 KB, patch)
2021-09-13 08:59 PDT, Razvan Caliman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Razvan Caliman 2021-09-10 08:27:46 PDT
`Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js:82`

The callback is confusingly named `propertyNamesCallback()` and has a `names` argument.

The payload is actually a list of objects with CSS property names, values, aliases, longhands, etc.

The constructor of `WI.CSSCompletions` expects and handles this payload.

Seems like `WI.CSSCompletions` began life handling just CSS property names, but overtime got overloaded to support additional use cases. 
For example, `WI.CSSCompletions` ends up having an instance of itself assigned as a property o_O:

```
WI.CSSCompletions.cssNameCompletions = new WI.CSSCompletions(properties, false);
```

There's a bit of confusing ping-pong between `WI.CSSCompletions` and `WI.CSSKeywordCompletions`.
But that's a fix for another patch.
Comment 1 Razvan Caliman 2021-09-10 08:35:40 PDT
Created attachment 437875 [details]
Patch 1.0
Comment 2 Radar WebKit Bug Importer 2021-09-10 09:29:12 PDT
<rdar://problem/82975738>
Comment 3 Devin Rousso 2021-09-10 16:12:49 PDT
Comment on attachment 437875 [details]
Patch 1.0

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

r=me

> Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js:88
> +        function propertiesCallback(error, properties)

NIT: this should really be named `cssProperties` to match what's used in the protocol
Comment 4 Razvan Caliman 2021-09-13 08:59:54 PDT
Created attachment 438046 [details]
Patch 1.1

Carry over R+
Comment 5 EWS 2021-09-13 14:41:05 PDT
Committed r282360 (241623@main): <https://commits.webkit.org/241623@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438046 [details].