Web Inspector: Add autocomplete controller for Visual property editors
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Aug 2015 18:43:46 +0000 (18:43 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Aug 2015 18:43:46 +0000 (18:43 +0000)
commit3f400cf24e0eb38d3d12d703aefcb2489feb348c
tree16f0b0ade714e984d262a6f188538388aa5166a6
parentcc04db449fe8f01aed90d17e3dbb8a4aa08e69f0
Web Inspector: Add autocomplete controller for Visual property editors
https://bugs.webkit.org/show_bug.cgi?id=147579

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/VisualStyleCompletionsController.js: Added.
(WebInspector.VisualStyleCompletionsController):
Takes in a CSSCompletions and displays a list of suggestions based on a given prefix in a popover.
(WebInspector.VisualStyleCompletionsController.prototype.get visible):
(WebInspector.VisualStyleCompletionsController.prototype.get hasCompletions):
(WebInspector.VisualStyleCompletionsController.prototype.get currentCompletion):
(WebInspector.VisualStyleCompletionsController.prototype.set completions):
(WebInspector.VisualStyleCompletionsController.prototype.completionSuggestionsViewCustomizeCompletionElement):
(WebInspector.VisualStyleCompletionsController.prototype.previous):
(WebInspector.VisualStyleCompletionsController.prototype.next):
(WebInspector.VisualStyleCompletionsController.prototype.update):
(WebInspector.VisualStyleCompletionsController.prototype.show):
(WebInspector.VisualStyleCompletionsController.prototype.hide):

* UserInterface/Models/CSSKeywordCompletions.js:
(WebInspector.CSSKeywordCompletions.forProperty):
Make sure that the cssNameCompletions exist before trying to add them.

* UserInterface/Views/CompletionSuggestionsView.js:
(WebInspector.CompletionSuggestionsView.prototype.update):
Allow the delegate to modify the newly created completion suggestion item.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/VisualStyleCompletionsController.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js
Source/WebInspectorUI/UserInterface/Views/CompletionSuggestionsView.js