WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 20:03:16 +0000 (20:03 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 20:03:16 +0000 (20:03 +0000)
commit699007c58ea6b0d49dd9cde697de457753914d6f
tree16802d0171ba0ce7e6d513f42d66ef4a3c1d0282
parent1f4c4d66af6be700fbfc4c5bf40cc7e27b6a1a72
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
38 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/5300379.html
LayoutTests/editing/deleting/delete-to-end-of-paragraph.html
LayoutTests/editing/deleting/smart-delete-003.html
LayoutTests/editing/deleting/smart-delete-004.html
LayoutTests/editing/execCommand/nsresponder-indent.html
LayoutTests/editing/execCommand/nsresponder-outdent.html
LayoutTests/editing/selection/4947387.html
LayoutTests/editing/selection/5195166-1.html
LayoutTests/editing/selection/5195166-2.html
LayoutTests/editing/selection/select-line.html
LayoutTests/editing/selection/selection-actions.html
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/editing/Editor.h
WebCore/editing/EditorCommand.cpp
WebCore/page/ContextMenuController.cpp
WebCore/page/mac/EventHandlerMac.mm
WebCore/page/mac/WebCoreFrameBridge.h
WebCore/page/mac/WebCoreFrameBridge.mm
WebKit/ChangeLog
WebKit/StringsNotToBeLocalized.txt
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
WebKit/gtk/WebView/webkitwebview.cpp
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebFrameBridge.h
WebKit/mac/WebCoreSupport/WebFrameBridge.mm
WebKit/mac/WebView/WebFrameView.mm
WebKit/mac/WebView/WebHTMLView.mm
WebKit/mac/WebView/WebHTMLViewInternal.h
WebKit/qt/Api/qwebpage.cpp
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/EditorClientQt.cpp
WebKit/win/ChangeLog
WebKit/win/WebView.cpp
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/EditorClientWx.cpp