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
+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
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];
#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 {
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,
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,
- (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;
- (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;
- (jobject)pollForAppletInView:(NSView *)view;
- (NSUndoManager *)undoManager;
-- (NSString *)nameForUndoAction:(WebUndoAction)undoAction;
+- (NSString *)undoNameForEditAction:(WebCore::EditAction)editAction;
- (void)issueCutCommand;
- (void)issueCopyCommand;
- (void)issuePasteCommand;
[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;
// 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
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);
}
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
setSelection(Selection(), false, false);
}
-void SelectionController::setModifyBias(EAlter alter, EDirection direction)
+void SelectionController::setModifyBias(EAlteration alter, EDirection direction)
{
switch (alter) {
case MOVE:
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")
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;
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;
class SelectionController : Noncopyable {
public:
- enum EAlter { MOVE, EXTEND };
+ enum EAlteration { MOVE, EXTEND };
enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT };
SelectionController(Frame* = 0, bool isDragCaretController = false);
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);
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(); }
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;
};
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,
+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.
[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;
}
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;
prepend:(BOOL)prepend
smartDeleteOK:(BOOL)smartDeleteOK
deletionAction:(WebDeletionAction)deletionAction
- granularity:(WebBridgeSelectionGranularity)granularity
+ granularity:(TextGranularity)granularity
{
WebFrameBridge *bridge = [self _bridge];
Frame* coreFrame = core([self _frame]);
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;
}
prepend:NO
smartDeleteOK:YES
deletionAction:deleteSelectionAction
- granularity:WebBridgeSelectByCharacter];
+ granularity:CharacterGranularity];
}
- (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard
- (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
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
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
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
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;
- (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
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;
}
}
-- (void)_applyParagraphStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction
+- (void)_applyParagraphStyleToSelection:(DOMCSSStyleDeclaration *)style withUndoAction:(EditAction)undoAction
{
if (style == nil || [style length] == 0 || ![self _canEditRichly])
return;
[style setFontWeight:@"bold"];
if ([[self _bridge] selectionStartHasStyle:style])
[style setFontWeight:@"normal"];
- [self _applyStyleToSelection:style withUndoAction:WebUndoActionSetFont];
+ [self _applyStyleToSelection:style withUndoAction:EditActionSetFont];
}
- (void)_toggleItalic
[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
{
// 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
- (void)changeFont:(id)sender
{
- [self _applyStyleToSelection:[self _styleFromFontManagerOperation] withUndoAction:WebUndoActionSetFont];
+ [self _applyStyleToSelection:[self _styleFromFontManagerOperation] withUndoAction:EditActionSetFont];
}
- (DOMCSSStyleDeclaration *)_styleForAttributeChange:(id)sender
- (void)changeAttributes:(id)sender
{
- [self _applyStyleToSelection:[self _styleForAttributeChange:sender] withUndoAction:WebUndoActionChangeAttributes];
+ [self _applyStyleToSelection:[self _styleForAttributeChange:sender] withUndoAction:EditActionChangeAttributes];
}
- (DOMCSSStyleDeclaration *)_styleFromColorPanelWithSelector:(SEL)selector
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
// 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;
- (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
[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.
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;
}
{
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
- (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
{
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
[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
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];
}
DOMCSSStyleDeclaration *style = [self _emptyStyle];
[style setDirection:direction];
- [self _applyParagraphStyleToSelection:style withUndoAction:WebUndoActionSetWritingDirection];
+ [self _applyParagraphStyleToSelection:style withUndoAction:EditActionSetWritingDirection];
}
- (void)changeBaseWritingDirection:(id)sender
DOMCSSStyleDeclaration *style = [self _emptyStyle];
[style setDirection:writingDirection == NSWritingDirectionLeftToRight ? @"LTR" : @"RTL"];
- [self _applyParagraphStyleToSelection:style withUndoAction:WebUndoActionSetWritingDirection];
+ [self _applyParagraphStyleToSelection:style withUndoAction:EditActionSetWritingDirection];
}
- (void)indent:(id)sender
- (BOOL)_canSmartCopyOrDelete
{
- return [[self _webView] smartInsertDeleteEnabled] && [[self _bridge] selectionGranularity] == WebBridgeSelectByWord;
+ return [[self _webView] smartInsertDeleteEnabled] && [[self _bridge] selectionGranularity] == WordGranularity;
}
- (DOMRange *)_smartDeleteRangeForProposedRange:(DOMRange *)proposedRange
// 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]];
[[webView _UIDelegateForwarder] webView:webView
willPerformDragDestinationAction:WebDragDestinationActionEdit
forDraggingInfo:draggingInfo];
- [innerBridge applyStyle:style withUndoAction:WebUndoActionSetColor];
+ [innerBridge applyStyle:style withUndoAction:EditActionSetColor];
return YES;
}
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];
{
// 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
{
// 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