| Summary: | Web Inspector: Add autocomplete controller for Visual property editors | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||||
| Component: | Web Inspector | Assignee: | Devin Rousso <hi> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 147563, 147570, 147578, 147711 | ||||||||
| Attachments: |
|
||||||||
|
Description
Devin Rousso
2015-08-03 11:50:46 PDT
Created attachment 258096 [details]
Patch
Comment on attachment 258096 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=258096&action=review > Source/WebInspectorUI/UserInterface/Controllers/VisualStyleCompletionsController.js:35 > + if (this._delegate && typeof this._delegate.completionSuggestionsOnItemCreated === "function") > + this.completionSuggestionsOnItemCreated = this._delegate.completionSuggestionsOnItemCreated; Delegates should be prefixed with the class name. So visualStyleCompletionsControllerCompletionSuggestionsOnItemCreated. It is also bad mojo to pass through a delegate. It would be better to either expose suggestionsView publicly so some other object can be its delegate, so likely the best option is to just bounce the delegate call though a similar delegate here. Delegates should also take "this" as the first argument, which ties to the reason the class name is in the method. It should not be assumes that the delegate is a 1-to-1 relationship, and they might need to know who is calling them. Also completionSuggestionsOnItemCreated does not make much sense to me currently. Would visualStyleCompletionsControllerCustomizeCompletionElement make sense? > Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js:180 > + this._delegate.completionSuggestionsOnItemCreated(itemElement, completions[i]); This would have a new method signature that includes the class name. It should also pass this to that method. So: this._delegate.completionSuggestionsViewCustomizeCompletionElement(this, itemElement, completions[i]); Then VisualStyleCompletionsController would implement that, and fire off visualStyleCompletionsControllerCustomizeCompletionElement. Created attachment 258992 [details]
Patch
Comment on attachment 258992 [details] Patch Clearing flags on attachment: 258992 Committed r188480: <http://trac.webkit.org/changeset/188480> All reviewed patches have been landed. Closing bug. |