Web Inspector: [TextPrompt] Autocomplete adds unwanted text that's hard to remove
authorapavlov@chromium.org <apavlov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 12:13:51 +0000 (12:13 +0000)
committerapavlov@chromium.org <apavlov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jan 2012 12:13:51 +0000 (12:13 +0000)
commit7ead5af2219d628e6f4ee3c4a8aef1099fe1075f
treeade4411538d5cee7a7a650ab3fafd0856753dea8
parent29c6f2d5967b5ebe9966e52ff852d09882f19be8
Web Inspector: [TextPrompt] Autocomplete adds unwanted text that's hard to remove
https://bugs.webkit.org/show_bug.cgi?id=76058

Reviewed by Pavel Feldman.

As per the results of a war room:
- Auto-suggest only after user typing (avoid showing suggestions when navigating through the user input.)
- Do not select the first item if the suggest box is shown at the end of prompt (to allow Enter to commit the input.)
- Only show grayed autocompletion at the end of prompt (otherwise show a suggest box with the first item selected.)
- Grayed autocompletion can only be accepted with the End or Right keys.
- Enter can accept a selected suggestion item from the list, without committing the input.
- Retain the CSS model editing behavior as close to the existing one as possible.
- Enable PageUp/PageDown to navigate the suggest box items.

* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylePropertyTreeElement.prototype):
():
* inspector/front-end/TextPrompt.js:
(WebInspector.TextPrompt.prototype.set text):
(WebInspector.TextPrompt.prototype._removeSuggestionAids):
(WebInspector.TextPrompt.prototype._selectStart.moveBackIfOutside):
(WebInspector.TextPrompt.prototype._selectStart):
(WebInspector.TextPrompt.prototype.onKeyDown):
(WebInspector.TextPrompt.prototype.acceptAutoComplete):
(WebInspector.TextPrompt.prototype.complete):
(WebInspector.TextPrompt.prototype._completionsReady):
(WebInspector.TextPrompt.prototype.isCaretAtEndOfPrompt):
(WebInspector.TextPrompt.prototype.tabKeyPressed):
(WebInspector.TextPrompt.prototype.downKeyPressed):
(WebInspector.TextPrompt.prototype.pageUpKeyPressed):
(WebInspector.TextPrompt.prototype.pageDownKeyPressed):
(WebInspector.TextPrompt.SuggestBox.prototype._onNextItem):
(WebInspector.TextPrompt.SuggestBox.prototype._onPreviousItem):
(WebInspector.TextPrompt.SuggestBox.prototype.updateSuggestions):
(WebInspector.TextPrompt.SuggestBox.prototype._updateItems):
(WebInspector.TextPrompt.SuggestBox.prototype._canShowBox):
(WebInspector.TextPrompt.SuggestBox.prototype._rememberRowCountPerViewport):
(WebInspector.TextPrompt.SuggestBox.prototype._completionsReady):
(WebInspector.TextPrompt.SuggestBox.prototype.pageUpKeyPressed):
(WebInspector.TextPrompt.SuggestBox.prototype.pageDownKeyPressed):
(WebInspector.TextPrompt.SuggestBox.prototype.enterKeyPressed):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/StylesSidebarPane.js
Source/WebCore/inspector/front-end/TextPrompt.js