Web Inspector: implement smart braces functionality
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 12:30:27 +0000 (12:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 12:30:27 +0000 (12:30 +0000)
commitb9950aca81c68420496b013e3990f5d1e72fb20c
tree4d80b89ee7b329d1b823f40723679d0f01f4efaa
parent4dd1accb3c816b5b74494e1040e98d816d8798bd
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
LayoutTests/ChangeLog
LayoutTests/inspector/editor/text-editor-smart-braces-expected.txt [new file with mode: 0644]
LayoutTests/inspector/editor/text-editor-smart-braces.html [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DefaultTextEditor.js
Source/WebCore/inspector/front-end/Settings.js
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp