WebCore:
Reviewed by Alexey.
- http://bugs.webkit.org/show_bug.cgi?id=16420
change regression tests to use document.execCommand instead of textInputController.doCommand
Add a few more operations to document.execCommand.
Finished up the transition to the new Editor::Command, including removing
the Editor::execCommand function.
* WebCore.base.exp: Added Editor::Command::isSupported.
* editing/Editor.h: Removed execCommand.
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity): Added.
(WebCore::verticalScrollDistance): Added; replaces canScroll.
(WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
(WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
(WebCore::executeDeleteForward): Ditto.
(WebCore::executeDeleteToBeginningOfLine): Ditto.
(WebCore::executeDeleteToBeginningOfParagraph): Ditto.
(WebCore::executeDeleteToEndOfLine): Ditto.
(WebCore::executeDeleteToEndOfParagraph): Ditto.
(WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
removing the explicit scrolling, and letting it be done automatically by code that makes
the caret visible. In some cases the old code would scroll twice which was harmless but
unnecessary.
(WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
(WebCore::executeMovePageUp): See MovePageDown above.
(WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
(WebCore::executeSelectLine): Ditto.
(WebCore::executeSelectParagraph): Ditto.
(WebCore::executeSelectSentence): Ditto.
(WebCore::executeSelectWord): Ditto.
(WebCore::executeSwapWithMark): Some small tweaks.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
bit more, but I didn't do that this time.
- Removed some obsolete unused code.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
NSTextView. This was left over from when we used NSTextField and NSTextView for form
elements and is no longer used at all.
* page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
of the bridge or another. We really need to find a time to tear down the rest of the
bridge, but that's not this patch.
* page/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
instead of using a method.
(-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
Took out obsolete comment about matching enums (we use a single enum now and have for some
time).
(-[WebCoreFrameBridge selectionGranularity]): Ditto.
WebKit:
* StringsNotToBeLocalized.txt: Updated.
WebKit/gtk:
Reviewed by Alexey.
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::handleKeyboardEvent): Changed to use Editor::command
instead of Editor::execCommand.
* WebView/webkitwebview.cpp: Ditto.
WebKit/mac:
Reviewed by Alexey.
- Changed a few more editing operations to use WebCore instead of WebKit.
- Removed some obsolete unused code.
* WebCoreSupport/WebFrameBridge.h: Moved declarations of methods that are both
defined and used on the WebKit side to here. These no longer belong on the bridge
and should be moved to the WebFrame class (or elsewhere).
* WebCoreSupport/WebFrameBridge.mm: Removed some unused methods.
* WebView/WebFrameView.mm:
(+[WebFrameView _viewTypesAllowImageTypeOmission:]): Fix typo in comment.
* WebView/WebHTMLView.mm:
(-[WebHTMLViewPrivate dealloc]): Removed unused firstResponderTextViewAtMouseDownTime.
(-[WebHTMLViewPrivate clear]): Ditto.
(-[WebHTMLView _setMouseDownEvent:]): Ditto.
(commandNameForSelector): Added special cases for pageDown:, pageDownAndModifySelection:,
pageUp:, and pageUpAndModifySelection:, since those names probably aren't specific enough
to be used in WebCore (what AppKit calls scrollPageDown: vs. pageDown: needs to be
disambiguated with the word "Move"). Added deleteBackward:,
deleteBackwardByDecomposingPreviousCharacter:, deleteForward:, deleteToBeginningOfLine:,
deleteToBeginningOfParagraph:, deleteToEndOfLine:, deleteToEndOfParagraph:, pageDown:,
pageDownAndModifySelection:, pageUp:, pageUpAndModifySelection:, selectLine:,
selectParagraph:, selectSentence:, and selectWord: to the list of commands that are
forwarded to WebCore.
(-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Eliminated the long list of
operations that we forward to WebCore. Instead, look up any command that WebCore can
handle, after any that we handle specially in WebHTMLView. Also fixed a bug where
an item that's not a menu item with changeBaseWritingDirection:NSWritingDirectionNatural
would end up enabled instead of disabled and streamlined the logic for toggleGrammarChecking:.
(-[WebHTMLView mouseDown:]): Removed unused firstResponderTextViewAtMouseDownTime.
(-[WebHTMLView becomeFirstResponder]): Removed unused willBecomeFirstResponderForNodeFocus.
(-[WebHTMLView resignFirstResponder]): Ditto.
(-[WebHTMLView checkSpelling:]): Took unneeded extra initialization of NSSpellChecker.
* WebView/WebHTMLViewInternal.h: Removed unused willBecomeFirstResponderForNodeFocus,
firstResponderTextViewAtMouseDownTime, _textViewWasFirstResponderAtMouseDownTime: and
_willMakeFirstResponderForNodeFocus.
WebKit/qt:
Reviewed by Alexey.
* Api/qwebpage.cpp:
(QWebPage::triggerAction): Removed some use of Editor member functions we plan
to eventually eliminate. Switch from Editor::execCommand to Editor::command.
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::handleKeyboardEvent): Ditto. Also updated name from
MoveUpByPageAndModifyCaret to MovePageUp and from MoveDownByPageAndModifyCaret
to MovePageDown.
WebKit/win:
Reviewed by Alexey.
* WebView.cpp:
(WebView::execCommand): Switched from Editor::execCommand to Editor:command.
Updated name from MoveUpByPageAndModifyCaret to MovePageUp and from
MoveDownByPageAndModifyCaret to MovePageDown.
(WebView::copy): Switched from Editor::execCommand to Editor:command.
(WebView::cut): Ditto.
(WebView::paste): Ditto.
(WebView::delete_): Ditto.
WebKit/wx:
Reviewed by Alexey.
* WebKitSupport/EditorClientWx.cpp:
(WebCore::EditorClientWx::handleKeyboardEvent): Switched from Editor::execCommand
to Edtor::command.
LayoutTests:
Reviewed by Alexey.
- http://bugs.webkit.org/show_bug.cgi?id=16420
change regression tests to use document.execCommand instead of textInputController.doCommand
To avoid changing results at this time, I didn't correct the many tests that now have
misleading "this test cannot be run manually" text or references to "NSResponder" or
uneeded instructions for running the test manually. We can do that on a later pass.
* editing/deleting/
5300379.html: Use execCommand instead of doCommand.
* editing/deleting/delete-to-end-of-paragraph.html: Ditto.
* editing/deleting/smart-delete-003.html: Ditto.
* editing/deleting/smart-delete-004.html: Ditto.
* editing/execCommand/nsresponder-indent.html: Ditto.
* editing/execCommand/nsresponder-outdent.html: Ditto.
* editing/selection/
4947387.html: Ditto.
* editing/selection/
5195166-1.html: Ditto.
* editing/selection/
5195166-2.html: Ditto.
* editing/selection/select-line.html: Ditto.
* editing/selection/selection-actions.html: Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28717
268f45cc-cd09-0410-ab3c-
d52691b4dbfc