WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Nov 2006 03:05:31 +0000 (03:05 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Nov 2006 03:05:31 +0000 (03:05 +0000)
        Reviewed by Geoff.

        Get rid of some duplicate editing enums. Also rename EAlter to EAlteration.

        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::registerCommandForUndoOrRedo):
        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
        (-[WebCoreFrameBridge alterCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
        (-[WebCoreFrameBridge alterCurrentSelection:SelectionController::verticalDistance:]):
        (-[WebCoreFrameBridge selectionGranularity]):
        (-[WebCoreFrameBridge deleteKeyPressedWithSmartDelete:granularity:]):
        (-[WebCoreFrameBridge forwardDeleteKeyPressedWithSmartDelete:granularity:]):
        (-[WebCoreFrameBridge setTypingStyle:withUndoAction:]):
        (-[WebCoreFrameBridge applyStyle:withUndoAction:]):
        (-[WebCoreFrameBridge applyParagraphStyle:withUndoAction:]):
        * editing/SelectionController.cpp:
        (WebCore::SelectionController::setModifyBias):
        (WebCore::SelectionController::modify):
        * editing/SelectionController.h:
        (WebCore::SelectionController::):
        * editing/TextGranularity.h:

WebKit:

        Reviewed by Geoff.

        Use the WebCore editing enums.

        * WebCoreSupport/WebFrameBridge.mm:
        (-[WebFrameBridge undoNameForEditAction:]):
        * WebView/WebHTMLView.m:
        (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:granularity:]):
        (-[WebHTMLView _deleteSelection]):
        (-[WebHTMLView moveBackward:]):
        (-[WebHTMLView moveBackwardAndModifySelection:]):
        (-[WebHTMLView moveDown:]):
        (-[WebHTMLView moveDownAndModifySelection:]):
        (-[WebHTMLView moveForward:]):
        (-[WebHTMLView moveForwardAndModifySelection:]):
        (-[WebHTMLView moveLeft:]):
        (-[WebHTMLView moveLeftAndModifySelection:]):
        (-[WebHTMLView moveRight:]):
        (-[WebHTMLView moveRightAndModifySelection:]):
        (-[WebHTMLView moveToBeginningOfDocument:]):
        (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]):
        (-[WebHTMLView moveToBeginningOfSentence:]):
        (-[WebHTMLView moveToBeginningOfSentenceAndModifySelection:]):
        (-[WebHTMLView moveToBeginningOfLine:]):
        (-[WebHTMLView moveToBeginningOfLineAndModifySelection:]):
        (-[WebHTMLView moveToBeginningOfParagraph:]):
        (-[WebHTMLView moveToBeginningOfParagraphAndModifySelection:]):
        (-[WebHTMLView moveToEndOfDocument:]):
        (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]):
        (-[WebHTMLView moveToEndOfSentence:]):
        (-[WebHTMLView moveToEndOfSentenceAndModifySelection:]):
        (-[WebHTMLView moveToEndOfLine:]):
        (-[WebHTMLView moveToEndOfLineAndModifySelection:]):
        (-[WebHTMLView moveToEndOfParagraph:]):
        (-[WebHTMLView moveToEndOfParagraphAndModifySelection:]):
        (-[WebHTMLView moveParagraphBackwardAndModifySelection:]):
        (-[WebHTMLView moveParagraphForwardAndModifySelection:]):
        (-[WebHTMLView moveUp:]):
        (-[WebHTMLView moveUpAndModifySelection:]):
        (-[WebHTMLView moveWordBackward:]):
        (-[WebHTMLView moveWordBackwardAndModifySelection:]):
        (-[WebHTMLView moveWordForward:]):
        (-[WebHTMLView moveWordForwardAndModifySelection:]):
        (-[WebHTMLView moveWordLeft:]):
        (-[WebHTMLView moveWordLeftAndModifySelection:]):
        (-[WebHTMLView moveWordRight:]):
        (-[WebHTMLView moveWordRightAndModifySelection:]):
        (-[WebHTMLView pageUp:]):
        (-[WebHTMLView pageDown:]):
        (-[WebHTMLView pageUpAndModifySelection:]):
        (-[WebHTMLView pageDownAndModifySelection:]):
        (-[WebHTMLView _expandSelectionToGranularity:]):
        (-[WebHTMLView selectParagraph:]):
        (-[WebHTMLView selectLine:]):
        (-[WebHTMLView selectSentence:]):
        (-[WebHTMLView selectWord:]):
        (-[WebHTMLView _applyStyleToSelection:withUndoAction:]):
        (-[WebHTMLView _applyParagraphStyleToSelection:withUndoAction:]):
        (-[WebHTMLView _toggleBold]):
        (-[WebHTMLView _toggleItalic]):
        (-[WebHTMLView pasteFont:]):
        (-[WebHTMLView changeFont:]):
        (-[WebHTMLView changeAttributes:]):
        (-[WebHTMLView _undoActionFromColorPanelWithSelector:]):
        (-[WebHTMLView changeColor:]):
        (-[WebHTMLView _alignSelectionUsingCSSValue:withUndoAction:]):
        (-[WebHTMLView alignCenter:]):
        (-[WebHTMLView alignJustified:]):
        (-[WebHTMLView alignLeft:]):
        (-[WebHTMLView alignRight:]):
        (-[WebHTMLView _deleteWithDirection:SelectionController::granularity:killRing:isTypingAction:]):
        (-[WebHTMLView deleteForward:]):
        (-[WebHTMLView deleteBackward:]):
        (-[WebHTMLView deleteWordForward:]):
        (-[WebHTMLView deleteWordBackward:]):
        (-[WebHTMLView deleteToBeginningOfLine:]):
        (-[WebHTMLView deleteToEndOfLine:]):
        (-[WebHTMLView deleteToBeginningOfParagraph:]):
        (-[WebHTMLView deleteToEndOfParagraph:]):
        (-[WebHTMLView subscript:]):
        (-[WebHTMLView superscript:]):
        (-[WebHTMLView unscript:]):
        (-[WebHTMLView underline:]):
        (-[WebHTMLView deleteToMark:]):
        (-[WebHTMLView toggleBaseWritingDirection:]):
        (-[WebHTMLView changeBaseWritingDirection:]):
        (-[WebHTMLView _canSmartCopyOrDelete]):
        (-[WebTextCompleteController doCompletion]):
        (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]):
        * WebView/WebView.mm:
        (-[WebView setTypingStyle:]):
        (-[WebView applyStyle:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17651 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/editing/SelectionController.cpp
WebCore/editing/SelectionController.h
WebCore/editing/TextGranularity.h
WebKit/ChangeLog
WebKit/WebCoreSupport/WebFrameBridge.mm
WebKit/WebView/WebHTMLView.m
WebKit/WebView/WebView.mm

index ee23d46e41ae778343162212f29e24a4450ccd44..00f1307b1161cf33be9f0c8351fe8f4e9a2a8efe 100644 (file)
@@ -1,3 +1,29 @@
+2006-11-07  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Geoff.
+
+        Get rid of some duplicate editing enums. Also rename EAlter to EAlteration.
+        
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::registerCommandForUndoOrRedo):
+        * bridge/mac/WebCoreFrameBridge.h:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
+        (-[WebCoreFrameBridge alterCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
+        (-[WebCoreFrameBridge alterCurrentSelection:SelectionController::verticalDistance:]):
+        (-[WebCoreFrameBridge selectionGranularity]):
+        (-[WebCoreFrameBridge deleteKeyPressedWithSmartDelete:granularity:]):
+        (-[WebCoreFrameBridge forwardDeleteKeyPressedWithSmartDelete:granularity:]):
+        (-[WebCoreFrameBridge setTypingStyle:withUndoAction:]):
+        (-[WebCoreFrameBridge applyStyle:withUndoAction:]):
+        (-[WebCoreFrameBridge applyParagraphStyle:withUndoAction:]):
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::setModifyBias):
+        (WebCore::SelectionController::modify):
+        * editing/SelectionController.h:
+        (WebCore::SelectionController::):
+        * editing/TextGranularity.h:
+
 2006-11-07  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Maciej
index 5e68ec406fa10d18e4fff93abe58fc7e8470ebf9..301ea0330ae0b3d3e65ed1fce1fe3c44bfa9483e 100644 (file)
@@ -2414,10 +2414,10 @@ void FrameMac::cleanupPluginObjects()
 void FrameMac::registerCommandForUndoOrRedo(PassRefPtr<EditCommand> cmd, bool isRedo)
 {
     ASSERT(cmd);
-    WebUndoAction action = static_cast<WebUndoAction>(cmd->editingAction());
+    EditAction editAction = cmd->editingAction();
     NSUndoManager* undoManager = [_bridge undoManager];
     WebCoreEditCommand* command = [WebCoreEditCommand commandWithEditCommand:cmd];
-    NSString* actionName = [_bridge nameForUndoAction:action];
+    NSString* actionName = [_bridge undoNameForEditAction:editAction];
     [undoManager registerUndoWithTarget:_bridge selector:(isRedo ? @selector(redoEditing:) : @selector(undoEditing:)) object:command];
     if (actionName)
         [undoManager setActionName:actionName];
index f059abcce627afbd46c16f80035e4cf32bb631ab..134e2505a21f9d5c1cac55a5dc50916ac3618e91 100644 (file)
 #import <JavaScriptCore/npruntime.h>
 #import <JavaVM/jni.h>
 #import <WebCore/WebCoreKeyboardAccess.h>
+#import <WebCore/EditAction.h>
+#import <WebCore/SelectionController.h>
 #import <WebCore/TextAffinity.h>
+#import <WebCore/TextGranularity.h>
+
 #ifdef __cplusplus
 
 namespace WebCore {
@@ -75,30 +79,6 @@ typedef enum {
     WebCoreDevicePrinter
 } WebCoreDeviceType;
 
-typedef enum {
-    WebSelectByMoving,
-    WebSelectByExtending
-} WebSelectionAlteration;
-
-typedef enum {
-    WebBridgeSelectForward,
-    WebBridgeSelectBackward,
-    WebBridgeSelectRight,
-    WebBridgeSelectLeft
-} WebBridgeSelectionDirection;
-
-typedef enum {
-    WebBridgeSelectByCharacter,
-    WebBridgeSelectByWord,
-    WebBridgeSelectBySentence,
-    WebBridgeSelectByLine,
-    WebBridgeSelectByParagraph,
-    WebBridgeSelectToSentenceBoundary,
-    WebBridgeSelectToLineBoundary,
-    WebBridgeSelectToParagraphBoundary,
-    WebBridgeSelectToDocumentBoundary
-} WebBridgeSelectionGranularity;
-
 typedef enum {
     WebScrollUp,
     WebScrollDown,
@@ -113,46 +93,6 @@ typedef enum {
     WebScrollWheel
 } WebScrollGranularity;
 
-typedef enum {
-    WebUndoActionUnspecified,
-    WebUndoActionSetColor,
-    WebUndoActionSetBackgroundColor,
-    WebUndoActionTurnOffKerning,
-    WebUndoActionTightenKerning,
-    WebUndoActionLoosenKerning,
-    WebUndoActionUseStandardKerning,
-    WebUndoActionTurnOffLigatures,
-    WebUndoActionUseStandardLigatures,
-    WebUndoActionUseAllLigatures,
-    WebUndoActionRaiseBaseline,
-    WebUndoActionLowerBaseline,
-    WebUndoActionSetTraditionalCharacterShape,
-    WebUndoActionSetFont,
-    WebUndoActionChangeAttributes,
-    WebUndoActionAlignLeft,
-    WebUndoActionAlignRight,
-    WebUndoActionCenter,
-    WebUndoActionJustify,
-    WebUndoActionSetWritingDirection,
-    WebUndoActionSubscript,
-    WebUndoActionSuperscript,
-    WebUndoActionUnderline,
-    WebUndoActionOutline,
-    WebUndoActionUnscript,
-    WebUndoActionDrag,
-    WebUndoActionCut,
-    WebUndoActionPaste,
-    WebUndoActionPasteFont,
-    WebUndoActionPasteRuler,
-    WebUndoActionTyping,
-    WebUndoActionCreateLink,
-    WebUndoActionUnlink,
-    WebUndoActionFormatBlock,
-    WebUndoActionInsertList,
-    WebUndoActionIndent,
-    WebUndoActionOutdent
-} WebUndoAction;
-
 typedef enum {
     ObjectElementNone,
     ObjectElementImage,
@@ -297,10 +237,10 @@ typedef enum {
 - (void)redoEditing:(id)arg;
 
 - (DOMRange *)rangeOfCharactersAroundCaret;
-- (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity;
-- (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity;
-- (void)alterCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)distance;
-- (WebBridgeSelectionGranularity)selectionGranularity;
+- (DOMRange *)rangeByAlteringCurrentSelection:(WebCore::SelectionController::EAlteration)alteration direction:(WebCore::SelectionController::EDirection)direction granularity:(WebCore::TextGranularity)granularity;
+- (void)alterCurrentSelection:(WebCore::SelectionController::EAlteration)alteration direction:(WebCore::SelectionController::EDirection)direction granularity:(WebCore::TextGranularity)granularity;
+- (void)alterCurrentSelection:(WebCore::SelectionController::EAlteration)alteration verticalDistance:(float)distance;
+- (WebCore::TextGranularity)selectionGranularity;
 - (DOMRange *)smartDeleteRangeForProposedRange:(DOMRange *)proposedCharRange;
 - (void)smartInsertForString:(NSString *)pasteString replacingRange:(DOMRange *)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString;
 - (void)selectNSRange:(NSRange)range;
@@ -338,13 +278,13 @@ typedef enum {
 - (DOMRange *)editableDOMRangeForPoint:(NSPoint)point;
 - (DOMRange *)characterRangeAtPoint:(NSPoint)point;
 
-- (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(WebBridgeSelectionGranularity)granularity;
-- (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(WebBridgeSelectionGranularity)granularity;
+- (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(WebCore::TextGranularity)granularity;
+- (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(WebCore::TextGranularity)granularity;
 
 - (DOMCSSStyleDeclaration *)typingStyle;
-- (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
-- (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
-- (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
+- (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebCore::EditAction)undoAction;
+- (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebCore::EditAction)undoAction;
+- (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebCore::EditAction)undoAction;
 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
 - (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
 
@@ -456,7 +396,7 @@ typedef enum {
 - (jobject)pollForAppletInView:(NSView *)view;
 
 - (NSUndoManager *)undoManager;
-- (NSString *)nameForUndoAction:(WebUndoAction)undoAction;
+- (NSString *)undoNameForEditAction:(WebCore::EditAction)editAction;
 - (void)issueCutCommand;
 - (void)issueCopyCommand;
 - (void)issuePasteCommand;
index 8d232778ab5c63d97a7b04b7877c28f4a2cecb1e..b7d07118f0493c637c2b81a7203c17afe2ee94b4 100644 (file)
@@ -1045,7 +1045,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     [arg command]->reapply();
 }
 
-- (DOMRange *)rangeByAlteringCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity
+- (DOMRange *)rangeByAlteringCurrentSelection:(SelectionController::EAlteration)alteration direction:(SelectionController::EDirection)direction granularity:(TextGranularity)granularity
 {
     if (m_frame->selectionController()->isNone())
         return nil;
@@ -1053,36 +1053,32 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     // NOTE: The enums *must* match the very similar ones declared in SelectionController.h
     SelectionController selectionController;
     selectionController.setSelection(m_frame->selectionController()->selection());
-    selectionController.modify(static_cast<SelectionController::EAlter>(alteration), 
-                               static_cast<SelectionController::EDirection>(direction), 
-                               static_cast<TextGranularity>(granularity));
+    selectionController.modify(alteration, direction, granularity);
     return [DOMRange _rangeWith:selectionController.toRange().get()];
 }
 
-- (void)alterCurrentSelection:(WebSelectionAlteration)alteration direction:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity
+- (void)alterCurrentSelection:(SelectionController::EAlteration)alteration direction:(SelectionController::EDirection)direction granularity:(TextGranularity)granularity
 {
     if (m_frame->selectionController()->isNone())
         return;
 
     // NOTE: The enums *must* match the very similar ones declared in SelectionController.h
     SelectionController* selectionController = m_frame->selectionController();
-    selectionController->modify(static_cast<SelectionController::EAlter>(alteration), 
-                                static_cast<SelectionController::EDirection>(direction), 
-                                static_cast<TextGranularity>(granularity), true);
+    selectionController->modify(alteration, direction, granularity, true);
 }
 
-- (void)alterCurrentSelection:(WebSelectionAlteration)alteration verticalDistance:(float)verticalDistance
+- (void)alterCurrentSelection:(SelectionController::EAlteration)alteration verticalDistance:(float)verticalDistance
 {
     if (m_frame->selectionController()->isNone())
         return;
     SelectionController* selectionController = m_frame->selectionController();
-    selectionController->modify(static_cast<SelectionController::EAlter>(alteration), static_cast<int>(verticalDistance), true);
+    selectionController->modify(alteration, static_cast<int>(verticalDistance), true);
 }
 
-- (WebBridgeSelectionGranularity)selectionGranularity
+- (TextGranularity)selectionGranularity
 {
     // NOTE: The enums *must* match the very similar ones declared in SelectionController.h
-    return static_cast<WebBridgeSelectionGranularity>(m_frame->selectionGranularity());
+    return m_frame->selectionGranularity();
 }
 
 - (NSRange)convertToNSRange:(Range *)range
@@ -1493,21 +1489,21 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     return nil;
 }
 
-- (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(WebBridgeSelectionGranularity)granularity
+- (void)deleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(TextGranularity)granularity
 {
     if (!m_frame || !m_frame->document())
         return;
     
-    TypingCommand::deleteKeyPressed(m_frame->document(), smartDelete, static_cast<TextGranularity>(granularity));
+    TypingCommand::deleteKeyPressed(m_frame->document(), smartDelete, granularity);
     m_frame->revealSelection(RenderLayer::gAlignToEdgeIfNeeded);
 }
 
-- (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(WebBridgeSelectionGranularity)granularity
+- (void)forwardDeleteKeyPressedWithSmartDelete:(BOOL)smartDelete granularity:(TextGranularity)granularity
 {
     if (!m_frame || !m_frame->document())
         return;
     
-    TypingCommand::forwardDeleteKeyPressed(m_frame->document(), smartDelete, static_cast<TextGranularity>(granularity));
+    TypingCommand::forwardDeleteKeyPressed(m_frame->document(), smartDelete, granularity);
     m_frame->revealSelection(RenderLayer::gAlignToEdgeIfNeeded);
 }
 
@@ -1518,25 +1514,25 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     return [DOMCSSStyleDeclaration _CSSStyleDeclarationWith:m_frame->typingStyle()->copy().get()];
 }
 
-- (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction
+- (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
 {
     if (!m_frame)
         return;
-    m_frame->computeAndSetTypingStyle([style _CSSStyleDeclaration], static_cast<EditAction>(undoAction));
+    m_frame->computeAndSetTypingStyle([style _CSSStyleDeclaration], undoAction);
 }
 
-- (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction
+- (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
 {
     if (!m_frame)
         return;
-    m_frame->applyStyle([style _CSSStyleDeclaration], static_cast<EditAction>(undoAction));
+    m_frame->applyStyle([style _CSSStyleDeclaration], undoAction);
 }
 
-- (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction
+- (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
 {
     if (!m_frame)
         return;
-    m_frame->applyParagraphStyle([style _CSSStyleDeclaration], static_cast<EditAction>(undoAction));
+    m_frame->applyParagraphStyle([style _CSSStyleDeclaration], undoAction);
 }
 
 - (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style
index e9fb021ae82acee3f3faee89e5d38c6fef6a8289..5e46f54a4fc56e77692cb37108a297e4853b652a 100644 (file)
@@ -188,7 +188,7 @@ void SelectionController::nodeWillBeRemoved(Node *node)
         setSelection(Selection(), false, false);
 }
 
-void SelectionController::setModifyBias(EAlter alter, EDirection direction)
+void SelectionController::setModifyBias(EAlteration alter, EDirection direction)
 {
     switch (alter) {
         case MOVE:
@@ -406,7 +406,7 @@ VisiblePosition SelectionController::modifyMovingLeftBackward(TextGranularity gr
 bool SelectionController::modify(const String &alterString, const String &directionString, const String &granularityString, bool userTriggered)
 {
     String alterStringLower = alterString.lower();
-    EAlter alter;
+    EAlteration alter;
     if (alterStringLower == "extend")
         alter = EXTEND;
     else if (alterStringLower == "move")
@@ -451,7 +451,7 @@ bool SelectionController::modify(const String &alterString, const String &direct
     return modify(alter, direction, granularity, userTriggered);
 }
 
-bool SelectionController::modify(EAlter alter, EDirection dir, TextGranularity granularity, bool userTriggered)
+bool SelectionController::modify(EAlteration alter, EDirection dir, TextGranularity granularity, bool userTriggered)
 {
     if (userTriggered) {
         SelectionController trialSelectionController;
@@ -530,7 +530,7 @@ static bool caretY(const VisiblePosition &c, int &y)
     return true;
 }
 
-bool SelectionController::modify(EAlter alter, int verticalDistance, bool userTriggered)
+bool SelectionController::modify(EAlteration alter, int verticalDistance, bool userTriggered)
 {
     if (verticalDistance == 0)
         return false;
index 4cf2dce1cc19ddda196d26f09e2d38c8a39d6fc1..0c5f3a0fff784662750b903ac262fb0ad3efcf10 100644 (file)
@@ -40,7 +40,7 @@ class VisiblePosition;
 
 class SelectionController : Noncopyable {
 public:
-    enum EAlter { MOVE, EXTEND };
+    enum EAlteration { MOVE, EXTEND };
     enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT };
 
     SelectionController(Frame* = 0, bool isDragCaretController = false);
@@ -70,8 +70,8 @@ public:
 
     EAffinity affinity() const { return m_sel.affinity(); }
 
-    bool modify(EAlter, EDirection, TextGranularity, bool userTriggered = false);
-    bool modify(EAlter, int verticalDistance, bool userTriggered = false);
+    bool modify(EAlteration, EDirection, TextGranularity, bool userTriggered = false);
+    bool modify(EAlteration, int verticalDistance, bool userTriggered = false);
     bool expandUsingGranularity(TextGranularity);
 
     void setBase(const VisiblePosition&, bool userTriggered = false);
@@ -88,7 +88,7 @@ public:
     void setNeedsLayout(bool flag = true);
 
     void clearModifyBias() { m_modifyBiasSet = false; }
-    void setModifyBias(EAlter, EDirection);
+    void setModifyBias(EAlteration, EDirection);
     
     bool isNone() const { return m_sel.isNone(); }
     bool isCaret() const { return m_sel.isCaret(); }
@@ -174,7 +174,7 @@ private:
     
     bool m_needsLayout : 1;       // true if the caret and expectedVisible rectangles need to be calculated
     bool m_modifyBiasSet : 1;     // true if the selection has been horizontally 
-                                  // modified with EAlter::EXTEND
+                                  // modified with EAlteration::EXTEND
     Frame* m_frame;
     bool m_isDragCaretController;
 };
index d95097254567dcd9a74013e778c7b8c29cfd1eed..351b0548cfe160ee061fa978064b3dd6749d173a 100644 (file)
@@ -29,8 +29,7 @@
 namespace WebCore {
 
 // FIXME: This really should be broken up into more than one concept.
-// Frame doesn't neeed the 3 boundaries in this enum.
-// NOTE: This MUST match WebBridgeSelectionGranularity
+// Frame doesn't need the 3 boundaries in this enum.
 enum TextGranularity {
     CharacterGranularity,
     WordGranularity,
index 68f3d1ef726d31a624231f6702c699a67a966c60..337084e6e65c49da7aa7389e1e783b2c55d6f77e 100644 (file)
@@ -1,3 +1,98 @@
+2006-11-07  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Geoff.
+
+        Use the WebCore editing enums.
+        
+        * WebCoreSupport/WebFrameBridge.mm:
+        (-[WebFrameBridge undoNameForEditAction:]):
+        * WebView/WebHTMLView.m:
+        (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:deletionAction:granularity:]):
+        (-[WebHTMLView _deleteSelection]):
+        (-[WebHTMLView moveBackward:]):
+        (-[WebHTMLView moveBackwardAndModifySelection:]):
+        (-[WebHTMLView moveDown:]):
+        (-[WebHTMLView moveDownAndModifySelection:]):
+        (-[WebHTMLView moveForward:]):
+        (-[WebHTMLView moveForwardAndModifySelection:]):
+        (-[WebHTMLView moveLeft:]):
+        (-[WebHTMLView moveLeftAndModifySelection:]):
+        (-[WebHTMLView moveRight:]):
+        (-[WebHTMLView moveRightAndModifySelection:]):
+        (-[WebHTMLView moveToBeginningOfDocument:]):
+        (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]):
+        (-[WebHTMLView moveToBeginningOfSentence:]):
+        (-[WebHTMLView moveToBeginningOfSentenceAndModifySelection:]):
+        (-[WebHTMLView moveToBeginningOfLine:]):
+        (-[WebHTMLView moveToBeginningOfLineAndModifySelection:]):
+        (-[WebHTMLView moveToBeginningOfParagraph:]):
+        (-[WebHTMLView moveToBeginningOfParagraphAndModifySelection:]):
+        (-[WebHTMLView moveToEndOfDocument:]):
+        (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]):
+        (-[WebHTMLView moveToEndOfSentence:]):
+        (-[WebHTMLView moveToEndOfSentenceAndModifySelection:]):
+        (-[WebHTMLView moveToEndOfLine:]):
+        (-[WebHTMLView moveToEndOfLineAndModifySelection:]):
+        (-[WebHTMLView moveToEndOfParagraph:]):
+        (-[WebHTMLView moveToEndOfParagraphAndModifySelection:]):
+        (-[WebHTMLView moveParagraphBackwardAndModifySelection:]):
+        (-[WebHTMLView moveParagraphForwardAndModifySelection:]):
+        (-[WebHTMLView moveUp:]):
+        (-[WebHTMLView moveUpAndModifySelection:]):
+        (-[WebHTMLView moveWordBackward:]):
+        (-[WebHTMLView moveWordBackwardAndModifySelection:]):
+        (-[WebHTMLView moveWordForward:]):
+        (-[WebHTMLView moveWordForwardAndModifySelection:]):
+        (-[WebHTMLView moveWordLeft:]):
+        (-[WebHTMLView moveWordLeftAndModifySelection:]):
+        (-[WebHTMLView moveWordRight:]):
+        (-[WebHTMLView moveWordRightAndModifySelection:]):
+        (-[WebHTMLView pageUp:]):
+        (-[WebHTMLView pageDown:]):
+        (-[WebHTMLView pageUpAndModifySelection:]):
+        (-[WebHTMLView pageDownAndModifySelection:]):
+        (-[WebHTMLView _expandSelectionToGranularity:]):
+        (-[WebHTMLView selectParagraph:]):
+        (-[WebHTMLView selectLine:]):
+        (-[WebHTMLView selectSentence:]):
+        (-[WebHTMLView selectWord:]):
+        (-[WebHTMLView _applyStyleToSelection:withUndoAction:]):
+        (-[WebHTMLView _applyParagraphStyleToSelection:withUndoAction:]):
+        (-[WebHTMLView _toggleBold]):
+        (-[WebHTMLView _toggleItalic]):
+        (-[WebHTMLView pasteFont:]):
+        (-[WebHTMLView changeFont:]):
+        (-[WebHTMLView changeAttributes:]):
+        (-[WebHTMLView _undoActionFromColorPanelWithSelector:]):
+        (-[WebHTMLView changeColor:]):
+        (-[WebHTMLView _alignSelectionUsingCSSValue:withUndoAction:]):
+        (-[WebHTMLView alignCenter:]):
+        (-[WebHTMLView alignJustified:]):
+        (-[WebHTMLView alignLeft:]):
+        (-[WebHTMLView alignRight:]):
+        (-[WebHTMLView _deleteWithDirection:SelectionController::granularity:killRing:isTypingAction:]):
+        (-[WebHTMLView deleteForward:]):
+        (-[WebHTMLView deleteBackward:]):
+        (-[WebHTMLView deleteWordForward:]):
+        (-[WebHTMLView deleteWordBackward:]):
+        (-[WebHTMLView deleteToBeginningOfLine:]):
+        (-[WebHTMLView deleteToEndOfLine:]):
+        (-[WebHTMLView deleteToBeginningOfParagraph:]):
+        (-[WebHTMLView deleteToEndOfParagraph:]):
+        (-[WebHTMLView subscript:]):
+        (-[WebHTMLView superscript:]):
+        (-[WebHTMLView unscript:]):
+        (-[WebHTMLView underline:]):
+        (-[WebHTMLView deleteToMark:]):
+        (-[WebHTMLView toggleBaseWritingDirection:]):
+        (-[WebHTMLView changeBaseWritingDirection:]):
+        (-[WebHTMLView _canSmartCopyOrDelete]):
+        (-[WebTextCompleteController doCompletion]):
+        (-[WebHTMLView concludeDragForDraggingInfo:actionMask:]):
+        * WebView/WebView.mm:
+        (-[WebView setTypingStyle:]):
+        (-[WebView applyStyle:]):
+
 2006-11-06  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Darin.
index 712716d76501d134ffc961ea3dd9e9d8b8f0a790..03b1b0adc583dbc9dc2c93b6b5c4902883ffac90 100644 (file)
@@ -1155,46 +1155,46 @@ static id <WebFormDelegate> formDelegate(WebFrameBridge *self)
     [highlighter paintHighlightForBox:boxRect onLine:lineRect behindText:text entireLine:line];
 }
 
-- (NSString *)nameForUndoAction:(WebUndoAction)undoAction
-{
-    switch (undoAction) {
-        case WebUndoActionUnspecified: return nil;
-        case WebUndoActionSetColor: return UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name");
-        case WebUndoActionSetBackgroundColor: return UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name");
-        case WebUndoActionTurnOffKerning: return UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name");
-        case WebUndoActionTightenKerning: return UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name");
-        case WebUndoActionLoosenKerning: return UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name");
-        case WebUndoActionUseStandardKerning: return UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name");
-        case WebUndoActionTurnOffLigatures: return UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name");
-        case WebUndoActionUseStandardLigatures: return UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name");
-        case WebUndoActionUseAllLigatures: return UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name");
-        case WebUndoActionRaiseBaseline: return UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name");
-        case WebUndoActionLowerBaseline: return UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name");
-        case WebUndoActionSetTraditionalCharacterShape: return UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name");
-        case WebUndoActionSetFont: return UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name");
-        case WebUndoActionChangeAttributes: return UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name");
-        case WebUndoActionAlignLeft: return UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name");
-        case WebUndoActionAlignRight: return UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name");
-        case WebUndoActionCenter: return UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name");
-        case WebUndoActionJustify: return UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name");
-        case WebUndoActionSetWritingDirection: return UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name");
-        case WebUndoActionSubscript: return UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name");
-        case WebUndoActionSuperscript: return UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name");
-        case WebUndoActionUnderline: return UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name");
-        case WebUndoActionOutline: return UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name");
-        case WebUndoActionUnscript: return UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name");
-        case WebUndoActionDrag: return UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name");
-        case WebUndoActionCut: return UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name");
-        case WebUndoActionPaste: return UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name");
-        case WebUndoActionPasteFont: return UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name");
-        case WebUndoActionPasteRuler: return UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name");
-        case WebUndoActionTyping: return UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name");
-        case WebUndoActionCreateLink: return UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name");
-        case WebUndoActionUnlink: return UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name");
-        case WebUndoActionInsertList: return UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name");
-        case WebUndoActionFormatBlock: return UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name");
-        case WebUndoActionIndent: return UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name");
-        case WebUndoActionOutdent: return UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name");
+- (NSString *)undoNameForEditAction:(EditAction)editAction
+{
+    switch (editAction) {
+        case EditActionUnspecified: return nil;
+        case EditActionSetColor: return UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name");
+        case EditActionSetBackgroundColor: return UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name");
+        case EditActionTurnOffKerning: return UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name");
+        case EditActionTightenKerning: return UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name");
+        case EditActionLoosenKerning: return UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name");
+        case EditActionUseStandardKerning: return UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name");
+        case EditActionTurnOffLigatures: return UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name");
+        case EditActionUseStandardLigatures: return UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name");
+        case EditActionUseAllLigatures: return UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name");
+        case EditActionRaiseBaseline: return UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name");
+        case EditActionLowerBaseline: return UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name");
+        case EditActionSetTraditionalCharacterShape: return UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name");
+        case EditActionSetFont: return UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name");
+        case EditActionChangeAttributes: return UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name");
+        case EditActionAlignLeft: return UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name");
+        case EditActionAlignRight: return UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name");
+        case EditActionCenter: return UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name");
+        case EditActionJustify: return UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name");
+        case EditActionSetWritingDirection: return UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name");
+        case EditActionSubscript: return UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name");
+        case EditActionSuperscript: return UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name");
+        case EditActionUnderline: return UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name");
+        case EditActionOutline: return UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name");
+        case EditActionUnscript: return UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name");
+        case EditActionDrag: return UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name");
+        case EditActionCut: return UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name");
+        case EditActionPaste: return UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name");
+        case EditActionPasteFont: return UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name");
+        case EditActionPasteRuler: return UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name");
+        case EditActionTyping: return UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name");
+        case EditActionCreateLink: return UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name");
+        case EditActionUnlink: return UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name");
+        case EditActionInsertList: return UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name");
+        case EditActionFormatBlock: return UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name");
+        case EditActionIndent: return UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name");
+        case EditActionOutdent: return UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name");
     }
     return nil;
 }
index 0ea7dbd195b9860e13ee806a29b3c67d166668f4..4ff33e84baf3daeba2481a3d80bc8a2da4842f5c 100644 (file)
@@ -214,7 +214,7 @@ extern "C" void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFramework
              prepend:(BOOL)prepend 
        smartDeleteOK:(BOOL)smartDeleteOK
       deletionAction:(WebDeletionAction)deletionAction
-         granularity:(WebBridgeSelectionGranularity)granularity;
+         granularity:(TextGranularity)granularity;
 - (void)_deleteSelection;
 - (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard;
 - (NSView *)_hitViewForEvent:(NSEvent *)event;
@@ -609,7 +609,7 @@ extern "C" void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFramework
              prepend:(BOOL)prepend 
        smartDeleteOK:(BOOL)smartDeleteOK 
       deletionAction:(WebDeletionAction)deletionAction
-         granularity:(WebBridgeSelectionGranularity)granularity
+         granularity:(TextGranularity)granularity
 {
     WebFrameBridge *bridge = [self _bridge];
     Frame* coreFrame = core([self _frame]);
@@ -639,11 +639,11 @@ extern "C" void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFramework
                 editor->deleteSelectionWithSmartDelete(smartDelete);
                 break;
             case deleteKeyAction:
-                selectRange(coreFrame->selectionController(), core(range), DOWNSTREAM, (granularity != WebBridgeSelectByCharacter));
+                selectRange(coreFrame->selectionController(), core(range), DOWNSTREAM, (granularity != CharacterGranularity));
                 [bridge deleteKeyPressedWithSmartDelete:smartDelete granularity:granularity];
                 break;
             case forwardDeleteKeyAction:
-                selectRange(coreFrame->selectionController(), core(range), DOWNSTREAM, (granularity != WebBridgeSelectByCharacter));
+                selectRange(coreFrame->selectionController(), core(range), DOWNSTREAM, (granularity != CharacterGranularity));
                 [bridge forwardDeleteKeyPressedWithSmartDelete:smartDelete granularity:granularity];
                 break;
         }
@@ -659,7 +659,7 @@ extern "C" void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFramework
                prepend:NO
          smartDeleteOK:YES
         deletionAction:deleteSelectionAction
-           granularity:WebBridgeSelectByCharacter];
+           granularity:CharacterGranularity];
 }
 
 - (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard
@@ -3540,229 +3540,229 @@ done:
 - (void)moveBackward:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::BACKWARD granularity:CharacterGranularity];
 }
 
 - (void)moveBackwardAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:CharacterGranularity];
 }
 
 - (void)moveDown:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectByLine];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::FORWARD granularity:LineGranularity];
 }
 
 - (void)moveDownAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByLine];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:LineGranularity];
 }
 
 - (void)moveForward:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::FORWARD granularity:CharacterGranularity];
 }
 
 - (void)moveForwardAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:CharacterGranularity];
 }
 
 - (void)moveLeft:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectLeft granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::LEFT granularity:CharacterGranularity];
 }
 
 - (void)moveLeftAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectLeft granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::LEFT granularity:CharacterGranularity];
 }
 
 - (void)moveRight:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectRight granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::RIGHT granularity:CharacterGranularity];
 }
 
 - (void)moveRightAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectRight granularity:WebBridgeSelectByCharacter];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::RIGHT granularity:CharacterGranularity];
 }
 
 - (void)moveToBeginningOfDocument:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectToDocumentBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::BACKWARD granularity:DocumentBoundary];
 }
 
 - (void)moveToBeginningOfDocumentAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectToDocumentBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:DocumentBoundary];
 }
 
 - (void)moveToBeginningOfSentence:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectToSentenceBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::BACKWARD granularity:SentenceBoundary];
 }
 
 - (void)moveToBeginningOfSentenceAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectToSentenceBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:SentenceBoundary];
 }
 
 - (void)moveToBeginningOfLine:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectToLineBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::BACKWARD granularity:LineBoundary];
 }
 
 - (void)moveToBeginningOfLineAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectToLineBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:LineBoundary];
 }
 
 - (void)moveToBeginningOfParagraph:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectToParagraphBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::BACKWARD granularity:ParagraphBoundary];
 }
 
 - (void)moveToBeginningOfParagraphAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectToParagraphBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:ParagraphBoundary];
 }
 
 - (void)moveToEndOfDocument:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectToDocumentBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::FORWARD granularity:DocumentBoundary];
 }
 
 - (void)moveToEndOfDocumentAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectToDocumentBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:DocumentBoundary];
 }
 
 - (void)moveToEndOfSentence:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectToSentenceBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::FORWARD granularity:SentenceBoundary];
 }
 
 - (void)moveToEndOfSentenceAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectToSentenceBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:SentenceBoundary];
 }
 
 - (void)moveToEndOfLine:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::FORWARD granularity:LineBoundary];
 }
 
 - (void)moveToEndOfLineAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:LineBoundary];
 }
 
 - (void)moveToEndOfParagraph:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectToParagraphBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::FORWARD granularity:ParagraphBoundary];
 }
 
 - (void)moveToEndOfParagraphAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectToParagraphBoundary];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:ParagraphBoundary];
 }
 
 - (void)moveParagraphBackwardAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByParagraph];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:ParagraphGranularity];
 }
 
 - (void)moveParagraphForwardAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByParagraph];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:ParagraphGranularity];
 }
 
 - (void)moveUp:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectByLine];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::BACKWARD granularity:LineGranularity];
 }
 
 - (void)moveUpAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByLine];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:LineGranularity];
 }
 
 - (void)moveWordBackward:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::BACKWARD granularity:WordGranularity];
 }
 
 - (void)moveWordBackwardAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::BACKWARD granularity:WordGranularity];
 }
 
 - (void)moveWordForward:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectForward granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::FORWARD granularity:WordGranularity];
 }
 
 - (void)moveWordForwardAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectForward granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::FORWARD granularity:WordGranularity];
 }
 
 - (void)moveWordLeft:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectLeft granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::LEFT granularity:WordGranularity];
 }
 
 - (void)moveWordLeftAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectLeft granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::LEFT granularity:WordGranularity];
 }
 
 - (void)moveWordRight:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving direction:WebBridgeSelectRight granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE direction:SelectionController::RIGHT granularity:WordGranularity];
 }
 
 - (void)moveWordRightAndModifySelection:(id)sender
 {
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending direction:WebBridgeSelectRight granularity:WebBridgeSelectByWord];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND direction:SelectionController::RIGHT granularity:WordGranularity];
 }
 
 - (void)pageUp:(id)sender
@@ -3771,7 +3771,7 @@ done:
     if (!frameView)
         return;
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving verticalDistance:-[frameView _verticalPageScrollDistance]];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE verticalDistance:-[frameView _verticalPageScrollDistance]];
 }
 
 - (void)pageDown:(id)sender
@@ -3780,7 +3780,7 @@ done:
     if (!frameView)
         return;
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByMoving verticalDistance:[frameView _verticalPageScrollDistance]];
+        [[self _bridge] alterCurrentSelection:SelectionController::MOVE verticalDistance:[frameView _verticalPageScrollDistance]];
 }
 
 - (void)pageUpAndModifySelection:(id)sender
@@ -3789,7 +3789,7 @@ done:
     if (!frameView)
         return;
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending verticalDistance:-[frameView _verticalPageScrollDistance]];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND verticalDistance:-[frameView _verticalPageScrollDistance]];
 }
 
 - (void)pageDownAndModifySelection:(id)sender
@@ -3798,10 +3798,10 @@ done:
     if (frameView == nil)
         return;
     if ([self _canAlterCurrentSelection])
-        [[self _bridge] alterCurrentSelection:WebSelectByExtending verticalDistance:[frameView _verticalPageScrollDistance]];
+        [[self _bridge] alterCurrentSelection:SelectionController::EXTEND verticalDistance:[frameView _verticalPageScrollDistance]];
 }
 
-- (void)_expandSelectionToGranularity:(WebBridgeSelectionGranularity)granularity
+- (void)_expandSelectionToGranularity:(TextGranularity)granularity
 {
     if (![self _canAlterCurrentSelection])
         return;
@@ -3828,22 +3828,22 @@ done:
 
 - (void)selectParagraph:(id)sender
 {
-    [self _expandSelectionToGranularity:WebBridgeSelectByParagraph];
+    [self _expandSelectionToGranularity:ParagraphGranularity];
 }
 
 - (void)selectLine:(id)sender
 {
-    [self _expandSelectionToGranularity:WebBridgeSelectByLine];
+    [self _expandSelectionToGranularity:LineGranularity];
 }
 
 - (void)selectSentence:(id)sender
 {
-    [self _expandSelectionToGranularity:WebBridgeSelectBySentence];
+    [self _expandSelectionToGranularity:SentenceGranularity];
 }
 
 - (void)selectWord:(id)sender
 {
-    [self _expandSelectionToGranularity:WebBridgeSelectByWord];
+    [self _expandSelectionToGranularity:WordGranularity];
 }
 
 - (void)delete:(id)sender
@@ -3981,7 +3981,7 @@ done:
     return style;
 }
 
-- (void)_applyStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction
+- (void)_applyStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
 {
     if (style == nil || [style length] == 0 || ![self _canEditRichly])
         return;
@@ -3992,7 +3992,7 @@ done:
     }
 }
 
-- (void)_applyParagraphStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction
+- (void)_applyParagraphStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
 {
     if (style == nil || [style length] == 0 || ![self _canEditRichly])
         return;
@@ -4008,7 +4008,7 @@ done:
     [style setFontWeight:@"bold"];
     if ([[self _bridge] selectionStartHasStyle:style])
         [style setFontWeight:@"normal"];
-    [self _applyStyleToSelection:style withUndoAction:WebUndoActionSetFont];
+    [self _applyStyleToSelection:style withUndoAction:EditActionSetFont];
 }
 
 - (void)_toggleItalic
@@ -4017,7 +4017,7 @@ done:
     [style setFontStyle:@"italic"];
     if ([[self _bridge] selectionStartHasStyle:style])
         [style setFontStyle:@"normal"];
-    [self _applyStyleToSelection:style withUndoAction:WebUndoActionSetFont];
+    [self _applyStyleToSelection:style withUndoAction:EditActionSetFont];
 }
 
 - (BOOL)_handleStyleKeyEquivalent:(NSEvent *)event
@@ -4079,7 +4079,7 @@ done:
 {
     // Read RTF with font attributes from the pasteboard.
     // Maybe later we should add a pasteboard type that contains CSS text for "native" copy and paste font.
-    [self _applyStyleToSelection:[self _styleFromFontAttributes:[self _fontAttributesFromFontPasteboard]] withUndoAction:WebUndoActionPasteFont];
+    [self _applyStyleToSelection:[self _styleFromFontAttributes:[self _fontAttributesFromFontPasteboard]] withUndoAction:EditActionPasteFont];
 }
 
 - (void)pasteAsRichText:(id)sender
@@ -4183,7 +4183,7 @@ done:
 
 - (void)changeFont:(id)sender
 {
-    [self _applyStyleToSelection:[self _styleFromFontManagerOperation] withUndoAction:WebUndoActionSetFont];
+    [self _applyStyleToSelection:[self _styleFromFontManagerOperation] withUndoAction:EditActionSetFont];
 }
 
 - (DOMCSSStyleDeclaration *)_styleForAttributeChange:(id)sender
@@ -4292,7 +4292,7 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 
 - (void)changeAttributes:(id)sender
 {
-    [self _applyStyleToSelection:[self _styleForAttributeChange:sender] withUndoAction:WebUndoActionChangeAttributes];
+    [self _applyStyleToSelection:[self _styleForAttributeChange:sender] withUndoAction:EditActionChangeAttributes];
 }
 
 - (DOMCSSStyleDeclaration *)_styleFromColorPanelWithSelector:(SEL)selector
@@ -4305,11 +4305,11 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
     return style;
 }
 
-- (WebUndoAction)_undoActionFromColorPanelWithSelector:(SEL)selector
+- (EditAction)_undoActionFromColorPanelWithSelector:(SEL)selector
 {
     if (selector == @selector(setBackgroundColor:))
-        return WebUndoActionSetBackgroundColor;    
-    return WebUndoActionSetColor;
+        return EditActionSetBackgroundColor;    
+    return EditActionSetColor;
 }
 
 - (void)_changeCSSColorUsingSelector:(SEL)selector inRange:(DOMRange *)range
@@ -4344,10 +4344,10 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
     // NSTextView. However, this might not be required for Tiger, since the background-color 
     // changing box in the font panel doesn't work in Mail (3674481), though it does in TextEdit.
     [self _applyStyleToSelection:[self _styleFromColorPanelWithSelector:@selector(setColor:)] 
-                  withUndoAction:WebUndoActionSetColor];
+                  withUndoAction:EditActionSetColor];
 }
 
-- (void)_alignSelectionUsingCSSValue:(NSString *)CSSAlignmentValue withUndoAction:(WebUndoAction)undoAction
+- (void)_alignSelectionUsingCSSValue:(NSString *)CSSAlignmentValue withUndoAction:(EditAction)undoAction
 {
     if (![self _canEditRichly])
         return;
@@ -4359,22 +4359,22 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 
 - (void)alignCenter:(id)sender
 {
-    [self _alignSelectionUsingCSSValue:@"center" withUndoAction:WebUndoActionCenter];
+    [self _alignSelectionUsingCSSValue:@"center" withUndoAction:EditActionCenter];
 }
 
 - (void)alignJustified:(id)sender
 {
-    [self _alignSelectionUsingCSSValue:@"justify" withUndoAction:WebUndoActionJustify];
+    [self _alignSelectionUsingCSSValue:@"justify" withUndoAction:EditActionJustify];
 }
 
 - (void)alignLeft:(id)sender
 {
-    [self _alignSelectionUsingCSSValue:@"left" withUndoAction:WebUndoActionAlignLeft];
+    [self _alignSelectionUsingCSSValue:@"left" withUndoAction:EditActionAlignLeft];
 }
 
 - (void)alignRight:(id)sender
 {
-    [self _alignSelectionUsingCSSValue:@"right" withUndoAction:WebUndoActionAlignRight];
+    [self _alignSelectionUsingCSSValue:@"right" withUndoAction:EditActionAlignRight];
 }
 
 - (void)insertTab:(id)sender
@@ -4457,7 +4457,7 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
     [self _changeWordCaseWithSelector:@selector(capitalizedString)];
 }
 
-- (BOOL)_deleteWithDirection:(WebBridgeSelectionDirection)direction granularity:(WebBridgeSelectionGranularity)granularity killRing:(BOOL)killRing isTypingAction:(BOOL)isTypingAction
+- (BOOL)_deleteWithDirection:(SelectionController::EDirection)direction granularity:(TextGranularity)granularity killRing:(BOOL)killRing isTypingAction:(BOOL)isTypingAction
 {
     // Delete the selection, if there is one.
     // If not, make a selection using the passed-in direction and granularity.
@@ -4476,12 +4476,12 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
             deletionAction = deleteKeyAction;
     } else {
         switch (direction) {
-            case WebBridgeSelectForward:
-            case WebBridgeSelectRight:
+            case SelectionController::FORWARD:
+            case SelectionController::RIGHT:
                 deletionAction = forwardDeleteKeyAction;
                 break;
-            case WebBridgeSelectBackward:
-            case WebBridgeSelectLeft:
+            case SelectionController::BACKWARD:
+            case SelectionController::LEFT:
                 deletionAction = deleteKeyAction;
                 break;
         }
@@ -4497,14 +4497,14 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 {
     if (![self _isEditable])
         return;
-    [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter killRing:NO isTypingAction:YES];
+    [self _deleteWithDirection:SelectionController::FORWARD granularity:CharacterGranularity killRing:NO isTypingAction:YES];
 }
 
 - (void)deleteBackward:(id)sender
 {
     if (![self _isEditable])
         return;
-    [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectByCharacter killRing:NO isTypingAction:YES];
+    [self _deleteWithDirection:SelectionController::BACKWARD granularity:CharacterGranularity killRing:NO isTypingAction:YES];
 }
 
 - (void)deleteBackwardByDecomposingPreviousCharacter:(id)sender
@@ -4515,38 +4515,38 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 
 - (void)deleteWordForward:(id)sender
 {
-    [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByWord killRing:YES isTypingAction:NO];
+    [self _deleteWithDirection:SelectionController::FORWARD granularity:WordGranularity killRing:YES isTypingAction:NO];
 }
 
 - (void)deleteWordBackward:(id)sender
 {
-    [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectByWord killRing:YES isTypingAction:NO];
+    [self _deleteWithDirection:SelectionController::BACKWARD granularity:WordGranularity killRing:YES isTypingAction:NO];
 }
 
 - (void)deleteToBeginningOfLine:(id)sender
 {
-    [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectToLineBoundary killRing:YES isTypingAction:NO];
+    [self _deleteWithDirection:SelectionController::BACKWARD granularity:LineBoundary killRing:YES isTypingAction:NO];
 }
 
 - (void)deleteToEndOfLine:(id)sender
 {
     // To match NSTextView, this command should delete the newline at the end of
     // a paragraph if you are at the end of a paragraph (like deleteToEndOfParagraph does below).
-    if (![self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectToLineBoundary killRing:YES isTypingAction:NO])
-        [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter killRing:YES isTypingAction:NO];
+    if (![self _deleteWithDirection:SelectionController::FORWARD granularity:LineBoundary killRing:YES isTypingAction:NO])
+        [self _deleteWithDirection:SelectionController::FORWARD granularity:CharacterGranularity killRing:YES isTypingAction:NO];
 }
 
 - (void)deleteToBeginningOfParagraph:(id)sender
 {
-    [self _deleteWithDirection:WebBridgeSelectBackward granularity:WebBridgeSelectToParagraphBoundary killRing:YES isTypingAction:NO];
+    [self _deleteWithDirection:SelectionController::BACKWARD granularity:ParagraphBoundary killRing:YES isTypingAction:NO];
 }
 
 - (void)deleteToEndOfParagraph:(id)sender
 {
     // Despite the name of the method, this should delete the newline if the caret is at the end of a paragraph.
     // If deletion to the end of the paragraph fails, we delete one character forward, which will delete the newline.
-    if (![self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectToParagraphBoundary killRing:YES isTypingAction:NO])
-        [self _deleteWithDirection:WebBridgeSelectForward granularity:WebBridgeSelectByCharacter killRing:YES isTypingAction:NO];
+    if (![self _deleteWithDirection:SelectionController::FORWARD granularity:ParagraphBoundary killRing:YES isTypingAction:NO])
+        [self _deleteWithDirection:SelectionController::FORWARD granularity:CharacterGranularity killRing:YES isTypingAction:NO];
 }
 
 - (void)complete:(id)sender
@@ -4665,21 +4665,21 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 {
     DOMCSSStyleDeclaration *style = [self _emptyStyle];
     [style setVerticalAlign:@"sub"];
-    [self _applyStyleToSelection:style withUndoAction:WebUndoActionSubscript];
+    [self _applyStyleToSelection:style withUndoAction:EditActionSubscript];
 }
 
 - (void)superscript:(id)sender
 {
     DOMCSSStyleDeclaration *style = [self _emptyStyle];
     [style setVerticalAlign:@"super"];
-    [self _applyStyleToSelection:style withUndoAction:WebUndoActionSuperscript];
+    [self _applyStyleToSelection:style withUndoAction:EditActionSuperscript];
 }
 
 - (void)unscript:(id)sender
 {
     DOMCSSStyleDeclaration *style = [self _emptyStyle];
     [style setVerticalAlign:@"baseline"];
-    [self _applyStyleToSelection:style withUndoAction:WebUndoActionUnscript];
+    [self _applyStyleToSelection:style withUndoAction:EditActionUnscript];
 }
 
 - (void)underline:(id)sender
@@ -4690,7 +4690,7 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
     [style setProperty:@"-khtml-text-decorations-in-effect" value:@"underline" priority:@""];
     if ([[self _bridge] selectionStartHasStyle:style])
         [style setProperty:@"-khtml-text-decorations-in-effect" value:@"none" priority:@""];
-    [self _applyStyleToSelection:style withUndoAction:WebUndoActionUnderline];
+    [self _applyStyleToSelection:style withUndoAction:EditActionUnderline];
 }
 
 - (void)yank:(id)sender
@@ -4754,7 +4754,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
         NS_HANDLER
             r = selection;
         NS_ENDHANDLER
-        [self _deleteRange:r killRing:YES prepend:YES smartDeleteOK:NO deletionAction:deleteSelectionAction granularity:WebBridgeSelectByCharacter];
+        [self _deleteRange:r killRing:YES prepend:YES smartDeleteOK:NO deletionAction:deleteSelectionAction granularity:CharacterGranularity];
     }
     [self setMark:sender];
 }
@@ -4845,7 +4845,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
     DOMCSSStyleDeclaration *style = [self _emptyStyle];
     [style setDirection:direction];
-    [self _applyParagraphStyleToSelection:style withUndoAction:WebUndoActionSetWritingDirection];
+    [self _applyParagraphStyleToSelection:style withUndoAction:EditActionSetWritingDirection];
 }
 
 - (void)changeBaseWritingDirection:(id)sender
@@ -4861,7 +4861,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
     DOMCSSStyleDeclaration *style = [self _emptyStyle];
     [style setDirection:writingDirection == NSWritingDirectionLeftToRight ? @"LTR" : @"RTL"];
-    [self _applyParagraphStyleToSelection:style withUndoAction:WebUndoActionSetWritingDirection];
+    [self _applyParagraphStyleToSelection:style withUndoAction:EditActionSetWritingDirection];
 }
 
 - (void)indent:(id)sender
@@ -5105,7 +5105,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (BOOL)_canSmartCopyOrDelete
 {
-    return [[self _webView] smartInsertDeleteEnabled] && [[self _bridge] selectionGranularity] == WebBridgeSelectByWord;
+    return [[self _webView] smartInsertDeleteEnabled] && [[self _bridge] selectionGranularity] == WordGranularity;
 }
 
 - (DOMRange *)_smartDeleteRangeForProposedRange:(DOMRange *)proposedRange
@@ -5691,8 +5691,8 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
         // Get preceeding word stem
         WebFrameBridge *bridge = [_view _bridge];
         DOMRange *selection = kit(core([_view _frame])->selectionController()->toRange().get());
-        DOMRange *wholeWord = [bridge rangeByAlteringCurrentSelection:WebSelectByExtending
-            direction:WebBridgeSelectBackward granularity:WebBridgeSelectByWord];
+        DOMRange *wholeWord = [bridge rangeByAlteringCurrentSelection:SelectionController::EXTEND
+            direction:SelectionController::BACKWARD granularity:WordGranularity];
         DOMRange *prefix = [wholeWord cloneRange];
         [prefix setEnd:[selection startContainer] offset:[selection startOffset]];
 
@@ -6068,7 +6068,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
         [[webView _UIDelegateForwarder] webView:webView
             willPerformDragDestinationAction:WebDragDestinationActionEdit
             forDraggingInfo:draggingInfo];
-        [innerBridge applyStyle:style withUndoAction:WebUndoActionSetColor];
+        [innerBridge applyStyle:style withUndoAction:EditActionSetColor];
         return YES;
     }
 
@@ -6083,7 +6083,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
             if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionDropped]) {
                 [[webView _UIDelegateForwarder] webView:webView willPerformDragDestinationAction:WebDragDestinationActionEdit forDraggingInfo:draggingInfo];
                 if ([innerView _isMoveDrag:draggingInfo]) {
-                    BOOL smartMove = [innerBridge selectionGranularity] == WebBridgeSelectByWord && [self _canSmartReplaceWithPasteboard:pasteboard];
+                    BOOL smartMove = [innerBridge selectionGranularity] == WordGranularity && [self _canSmartReplaceWithPasteboard:pasteboard];
                     [innerBridge moveSelectionToDragCaret:fragment smartMove:smartMove];
                 } else {
                     [innerBridge setSelectionToDragCaret];
index ac1e64cc3279197d48d896000d75291da9b25597..39f4e827fca3b0c9704471dbe123b7edd1a260a6 100644 (file)
@@ -3227,7 +3227,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 {
     // We don't know enough at thls level to pass in a relevant WebUndoAction; we'd have to
     // change the API to allow this.
-    [[self _bridgeForSelectedOrMainFrame] setTypingStyle:style withUndoAction:WebUndoActionUnspecified];
+    [[self _bridgeForSelectedOrMainFrame] setTypingStyle:style withUndoAction:EditActionUnspecified];
 }
 
 - (DOMCSSStyleDeclaration *)typingStyle
@@ -3397,7 +3397,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 {
     // We don't know enough at thls level to pass in a relevant WebUndoAction; we'd have to
     // change the API to allow this.
-    [[self _bridgeForSelectedOrMainFrame] applyStyle:style withUndoAction:WebUndoActionUnspecified];
+    [[self _bridgeForSelectedOrMainFrame] applyStyle:style withUndoAction:EditActionUnspecified];
 }
 
 @end