Web Inspector: implement smart braces functionality
https://bugs.webkit.org/show_bug.cgi?id=109200
Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-02-15
Reviewed by Pavel Feldman.
Source/WebCore:
- implement SmartBraceController which will handle character insertions
and override them if brace character was inserted. Additionally it
should handle Backspace key and override it if a cursor is located
inside of a bracket pair.
- guard smart brace functionality via experiment checkbox.
New test: inspector/editor/text-editor-smart-braces.html
* inspector/front-end/DefaultTextEditor.js:
(WebInspector.TextEditorMainPanel):
(WebInspector.TextEditorMainPanel.prototype._registerShortcuts):
(WebInspector.TextEditorMainPanel.prototype._handleKeyPress):
(WebInspector.TextEditorMainPanel.SmartBraceController):
(WebInspector.TextEditorMainPanel.SmartBraceController.prototype.registerShortcuts):
(WebInspector.TextEditorMainPanel.SmartBraceController.prototype.registerCharOverrides):
(WebInspector.TextEditorMainPanel.SmartBraceController.prototype._handleBackspace):
(WebInspector.TextEditorMainPanel.SmartBraceController.prototype._handleBracePairInsertion):
(WebInspector.TextEditorMainPanel.SmartBraceController.prototype._handleClosingBraceOverride):
* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings):
Tools:
Fix eventSender.keyDown implementation to correctly process opening
round brace symbol.
* DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:
(WebTestRunner):
(WebTestRunner::EventSender::keyDown):
LayoutTests:
* inspector/editor/text-editor-smart-braces-expected.txt: Added.
* inspector/editor/text-editor-smart-braces.html: Added.
* platform/efl/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142983
268f45cc-cd09-0410-ab3c-
d52691b4dbfc