Commit bfb682fd authored by rniwa@webkit.org's avatar rniwa@webkit.org

2010-12-22 Ryosuke Niwa <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        Editor.h doesn't need to include SelectionController.h
        https://bugs.webkit.org/show_bug.cgi?id=51441

        Renamed SelectionController::EDirection to SelectionDirection.

        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::executeCommand):
2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        Editor.h doesn't need to include SelectionController.h
        https://bugs.webkit.org/show_bug.cgi?id=51441

        Renamed SelectionController::EDirection to SelectionDirection.

        * WebCoreSupport/EditorClientQt.cpp:
        (WebCore::EditorClientQt::handleKeyboardEvent):
2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        Editor.h doesn't need to include SelectionController.h
        https://bugs.webkit.org/show_bug.cgi?id=51441

        Renamed SelectionController::EDirection to SelectionDirection.

        * WebView/WebFrame.mm:
        (-[WebFrame _rangeByAlteringCurrentSelection:SelectionController::direction:granularity:]):
        Takes SelectionDirection instead of SelectionController::EDirection.
        * WebView/WebFrameInternal.h:
        * WebView/WebTextCompletionController.mm:
        (-[WebTextCompletionController doCompletion]): Calls _rangeByAlteringCurrentSelection:SelectionController.
2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        Editor.h doesn't need to include SelectionController.h
        https://bugs.webkit.org/show_bug.cgi?id=51441

        Renamed SelectionController::EDirection to SelectionDirection.

        * WebCoreSupport/EditorClientHaiku.cpp:
        (WebCore::EditorClientHaiku::handleKeyboardEvent):
2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        Editor.h doesn't need to include SelectionController.h
        https://bugs.webkit.org/show_bug.cgi?id=51441

        Renamed SelectionController::EDirection to SelectionDirection.

        * WebCoreSupport/EditorClientWinCE.cpp:
        (WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        Editor.h doesn't need to include SelectionController.h
        https://bugs.webkit.org/show_bug.cgi?id=51441

        Renamed SelectionController::EDirection to SelectionDirection.

        * WebCoreSupport/EditorClientEfl.cpp:
        (WebCore::EditorClientEfl::handleEditingKeyboardEvent):
2010-12-22  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Eric Seidel.

        Editor.h doesn't need to include SelectionController.h
        https://bugs.webkit.org/show_bug.cgi?id=51441

        Removed #include <Selection.h> from Editor.h.
        Also extracted WritingDirection.h from EditingStyle.h and renamed SelectionController::EDirection
        to SelectionDirection and moved its declaration from SelectionController.h to VisibleSelection.h

        * WebCore.exp.in: Signature changes.
        * WebCore.xcodeproj/project.pbxproj: Added WritingDirection.h
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::visiblePositionRangeForLine): Change due to SelectionDirection.
        * editing/EditingStyle.h: Removed WritingDirection and included WritingDirection.h
        * editing/Editor.cpp:
        (WebCore::Editor::deleteWithDirection): Change due to SelectionDirection.
        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Ditto.
        (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
        * editing/Editor.h: Removed SelectionController.h; added DocumentMarker.h, Timer.h, VisibleSelection.h
        and WritingDirection.h; forward declared CSSMutableStyleDeclaration.
        * editing/EditorCommand.cpp:
        (WebCore::executeDeleteBackward): Change due to SelectionDirection.
        (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
        (WebCore::executeDeleteForward): Ditto.
        (WebCore::executeDeleteToBeginningOfLine): Ditto.
        (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
        (WebCore::executeDeleteToEndOfLine): Ditto.
        (WebCore::executeDeleteToEndOfParagraph): Ditto.
        (WebCore::executeDeleteWordBackward): Ditto.
        (WebCore::executeDeleteWordForward): Ditto.
        (WebCore::executeForwardDelete): Ditto.
        (WebCore::executeMoveBackward): Ditto.
        (WebCore::executeMoveBackwardAndModifySelection): Ditto.
        (WebCore::executeMoveDown): Ditto.
        (WebCore::executeMoveDownAndModifySelection): Ditto.
        (WebCore::executeMoveForward): Ditto.
        (WebCore::executeMoveForwardAndModifySelection): Ditto.
        (WebCore::executeMoveLeft): Ditto.
        (WebCore::executeMoveLeftAndModifySelection): Ditto.
        (WebCore::executeMoveRight): Ditto.
        (WebCore::executeMoveRightAndModifySelection): Ditto.
        (WebCore::executeMoveToBeginningOfDocument): Ditto.
        (WebCore::executeMoveToBeginningOfDocumentAndModifySelection): Ditto.
        (WebCore::executeMoveToBeginningOfLine): Ditto.
        (WebCore::executeMoveToBeginningOfLineAndModifySelection): Ditto.
        (WebCore::executeMoveToBeginningOfParagraph): Ditto.
        (WebCore::executeMoveToBeginningOfParagraphAndModifySelection): Ditto.
        (WebCore::executeMoveToBeginningOfSentence): Ditto.
        (WebCore::executeMoveToBeginningOfSentenceAndModifySelection): Ditto.
        (WebCore::executeMoveToEndOfDocument): Ditto.
        (WebCore::executeMoveToEndOfDocumentAndModifySelection): Ditto.
        (WebCore::executeMoveToEndOfSentence): Ditto.
        (WebCore::executeMoveToEndOfSentenceAndModifySelection): Ditto.
        (WebCore::executeMoveToEndOfLine): Ditto.
        (WebCore::executeMoveToEndOfLineAndModifySelection): Ditto.
        (WebCore::executeMoveToEndOfParagraph): Ditto.
        (WebCore::executeMoveToEndOfParagraphAndModifySelection): Ditto.
        (WebCore::executeMoveParagraphBackwardAndModifySelection): Ditto.
        (WebCore::executeMoveParagraphForwardAndModifySelection): Ditto.
        (WebCore::executeMoveUp): Ditto.
        (WebCore::executeMoveUpAndModifySelection): Ditto.
        (WebCore::executeMoveWordBackward): Ditto.
        (WebCore::executeMoveWordBackwardAndModifySelection): Ditto.
        (WebCore::executeMoveWordForward): Ditto.
        (WebCore::executeMoveWordForwardAndModifySelection): Ditto.
        (WebCore::executeMoveWordLeft): Ditto.
        (WebCore::executeMoveWordLeftAndModifySelection): Ditto.
        (WebCore::executeMoveWordRight): Ditto.
        (WebCore::executeMoveWordRightAndModifySelection): Ditto.
        (WebCore::executeMoveToLeftEndOfLine): Ditto.
        (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Ditto.
        (WebCore::executeMoveToRightEndOfLine): Ditto.
        (WebCore::executeMoveToRightEndOfLineAndModifySelection): Ditto.
        * editing/SelectionController.cpp:
        (WebCore::SelectionController::willBeModified): Takes SelectionDirection instead of EDirection.
        (WebCore::SelectionController::modify): Ditto.
        * editing/SelectionController.h: Change due to SelectionDirection.
        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::deleteKeyPressed): Ditto.
        (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
        * editing/VisibleSelection.h: Added SelectionDirection, renamed and moved from EDirection
        in SelectionController.h
        * editing/WritingDirection.h: Added.
        * page/DOMSelection.cpp:
        (WebCore::DOMSelection::modify): Change due to SelectionDirection.
        (WebCore::DOMSelection::deleteFromDocument): Ditto.
        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleKeyboardSelectionMovement): Ditto.
        * page/Frame.h: Includes SelectionController.h.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3e5d1260
2010-12-22 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Eric Seidel.
Editor.h doesn't need to include SelectionController.h
https://bugs.webkit.org/show_bug.cgi?id=51441
Removed #include <Selection.h> from Editor.h.
Also extracted WritingDirection.h from EditingStyle.h and renamed SelectionController::EDirection
to SelectionDirection and moved its declaration from SelectionController.h to VisibleSelection.h
* WebCore.exp.in: Signature changes.
* WebCore.xcodeproj/project.pbxproj: Added WritingDirection.h
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionRangeForLine): Change due to SelectionDirection.
* editing/EditingStyle.h: Removed WritingDirection and included WritingDirection.h
* editing/Editor.cpp:
(WebCore::Editor::deleteWithDirection): Change due to SelectionDirection.
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Ditto.
(WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
* editing/Editor.h: Removed SelectionController.h; added DocumentMarker.h, Timer.h, VisibleSelection.h
and WritingDirection.h; forward declared CSSMutableStyleDeclaration.
* editing/EditorCommand.cpp:
(WebCore::executeDeleteBackward): Change due to SelectionDirection.
(WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
(WebCore::executeDeleteForward): Ditto.
(WebCore::executeDeleteToBeginningOfLine): Ditto.
(WebCore::executeDeleteToBeginningOfParagraph): Ditto.
(WebCore::executeDeleteToEndOfLine): Ditto.
(WebCore::executeDeleteToEndOfParagraph): Ditto.
(WebCore::executeDeleteWordBackward): Ditto.
(WebCore::executeDeleteWordForward): Ditto.
(WebCore::executeForwardDelete): Ditto.
(WebCore::executeMoveBackward): Ditto.
(WebCore::executeMoveBackwardAndModifySelection): Ditto.
(WebCore::executeMoveDown): Ditto.
(WebCore::executeMoveDownAndModifySelection): Ditto.
(WebCore::executeMoveForward): Ditto.
(WebCore::executeMoveForwardAndModifySelection): Ditto.
(WebCore::executeMoveLeft): Ditto.
(WebCore::executeMoveLeftAndModifySelection): Ditto.
(WebCore::executeMoveRight): Ditto.
(WebCore::executeMoveRightAndModifySelection): Ditto.
(WebCore::executeMoveToBeginningOfDocument): Ditto.
(WebCore::executeMoveToBeginningOfDocumentAndModifySelection): Ditto.
(WebCore::executeMoveToBeginningOfLine): Ditto.
(WebCore::executeMoveToBeginningOfLineAndModifySelection): Ditto.
(WebCore::executeMoveToBeginningOfParagraph): Ditto.
(WebCore::executeMoveToBeginningOfParagraphAndModifySelection): Ditto.
(WebCore::executeMoveToBeginningOfSentence): Ditto.
(WebCore::executeMoveToBeginningOfSentenceAndModifySelection): Ditto.
(WebCore::executeMoveToEndOfDocument): Ditto.
(WebCore::executeMoveToEndOfDocumentAndModifySelection): Ditto.
(WebCore::executeMoveToEndOfSentence): Ditto.
(WebCore::executeMoveToEndOfSentenceAndModifySelection): Ditto.
(WebCore::executeMoveToEndOfLine): Ditto.
(WebCore::executeMoveToEndOfLineAndModifySelection): Ditto.
(WebCore::executeMoveToEndOfParagraph): Ditto.
(WebCore::executeMoveToEndOfParagraphAndModifySelection): Ditto.
(WebCore::executeMoveParagraphBackwardAndModifySelection): Ditto.
(WebCore::executeMoveParagraphForwardAndModifySelection): Ditto.
(WebCore::executeMoveUp): Ditto.
(WebCore::executeMoveUpAndModifySelection): Ditto.
(WebCore::executeMoveWordBackward): Ditto.
(WebCore::executeMoveWordBackwardAndModifySelection): Ditto.
(WebCore::executeMoveWordForward): Ditto.
(WebCore::executeMoveWordForwardAndModifySelection): Ditto.
(WebCore::executeMoveWordLeft): Ditto.
(WebCore::executeMoveWordLeftAndModifySelection): Ditto.
(WebCore::executeMoveWordRight): Ditto.
(WebCore::executeMoveWordRightAndModifySelection): Ditto.
(WebCore::executeMoveToLeftEndOfLine): Ditto.
(WebCore::executeMoveToLeftEndOfLineAndModifySelection): Ditto.
(WebCore::executeMoveToRightEndOfLine): Ditto.
(WebCore::executeMoveToRightEndOfLineAndModifySelection): Ditto.
* editing/SelectionController.cpp:
(WebCore::SelectionController::willBeModified): Takes SelectionDirection instead of EDirection.
(WebCore::SelectionController::modify): Ditto.
* editing/SelectionController.h: Change due to SelectionDirection.
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed): Ditto.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
* editing/VisibleSelection.h: Added SelectionDirection, renamed and moved from EDirection
in SelectionController.h
* editing/WritingDirection.h: Added.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::modify): Change due to SelectionDirection.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleKeyboardSelectionMovement): Ditto.
* page/Frame.h: Includes SelectionController.h.
2010-12-23 Adam Barth <abarth@webkit.org>
Reviewed by Darin Adler.
......
......@@ -477,7 +477,7 @@ __ZN7WebCore19SelectionController15revealSelectionERKNS_15ScrollAlignmentEb
__ZN7WebCore19SelectionController16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
__ZN7WebCore19SelectionController20setSelectionFromNoneEv
__ZN7WebCore19SelectionController5clearEv
__ZN7WebCore19SelectionController6modifyENS0_11EAlterationENS0_10EDirectionENS_15TextGranularityEb
__ZN7WebCore19SelectionController6modifyENS0_11EAlterationENS_18SelectionDirectionENS_15TextGranularityEb
__ZN7WebCore19SelectionController9selectAllEv
__ZN7WebCore19SelectionControllerC1EPNS_5FrameEb
__ZN7WebCore19TextResourceDecoder5flushEv
......@@ -694,11 +694,11 @@ __ZN7WebCore6Editor17insertOrderedListEv
__ZN7WebCore6Editor18confirmCompositionERKN3WTF6StringE
__ZN7WebCore6Editor18confirmCompositionEv
__ZN7WebCore6Editor19countMatchesForTextERKN3WTF6StringEPNS_5RangeEjjb
__ZN7WebCore6Editor19deleteWithDirectionENS_19SelectionController10EDirectionENS_15TextGranularityEbb
__ZN7WebCore6Editor19deleteWithDirectionENS_18SelectionDirectionENS_15TextGranularityEbb
__ZN7WebCore6Editor19insertUnorderedListEv
__ZN7WebCore6Editor21applyStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
__ZN7WebCore6Editor21isSelectionMisspelledEv
__ZN7WebCore6Editor23setBaseWritingDirectionENS_16WritingDirectionE
__ZN7WebCore6Editor23setBaseWritingDirectionE16WritingDirection
__ZN7WebCore6Editor24advanceToNextMisspellingEb
__ZN7WebCore6Editor24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
__ZN7WebCore6Editor24isSelectionUngrammaticalEv
......
......@@ -3041,6 +3041,7 @@
9B417065125662B3006B28FC /* ApplyBlockElementCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */; };
9BAB6C6C12550631001626D4 /* EditingStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BAB6C6A12550631001626D4 /* EditingStyle.h */; settings = {ATTRIBUTES = (Private, ); }; };
9BAB6C6D12550631001626D4 /* EditingStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BAB6C6B12550631001626D4 /* EditingStyle.cpp */; };
9BAF3B2412C1A39800014BF1 /* WritingDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BAF3B2312C1A39800014BF1 /* WritingDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */; };
9BD0BF9412A42BF50072FD43 /* ScopedEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BD0BF9212A42BF50072FD43 /* ScopedEventQueue.cpp */; };
9F0D6B2E121BFEBA006C0288 /* InspectorProfilerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */; };
......@@ -9367,6 +9368,7 @@
9B417063125662B3006B28FC /* ApplyBlockElementCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplyBlockElementCommand.cpp; sourceTree = "<group>"; };
9BAB6C6A12550631001626D4 /* EditingStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditingStyle.h; sourceTree = "<group>"; };
9BAB6C6B12550631001626D4 /* EditingStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditingStyle.cpp; sourceTree = "<group>"; };
9BAF3B2312C1A39800014BF1 /* WritingDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritingDirection.h; sourceTree = "<group>"; };
9BD0BF9112A42BF50072FD43 /* ScopedEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopedEventQueue.h; sourceTree = "<group>"; };
9BD0BF9212A42BF50072FD43 /* ScopedEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScopedEventQueue.cpp; sourceTree = "<group>"; };
9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorProfilerAgent.cpp; sourceTree = "<group>"; };
......@@ -15150,6 +15152,7 @@
A883DF260F3D045D00F19BF6 /* VisibleSelection.h */,
93309DD4099E64910056E581 /* WrapContentsInDummySpanCommand.cpp */,
93309DD5099E64910056E581 /* WrapContentsInDummySpanCommand.h */,
9BAF3B2312C1A39800014BF1 /* WritingDirection.h */,
);
path = editing;
sourceTree = "<group>";
......@@ -22096,6 +22099,7 @@
0B9056F90F2685F30095FF6A /* WorkerThreadableLoader.h in Headers */,
5112247A10CFB8FF008099D7 /* WorkerThreadableWebSocketChannel.h in Headers */,
93309E24099E64920056E581 /* WrapContentsInDummySpanCommand.h in Headers */,
9BAF3B2412C1A39800014BF1 /* WritingDirection.h in Headers */,
6565820209D1508D000E61D7 /* XLinkNames.h in Headers */,
93F1992108245E59001E9ABC /* XMLDocumentParser.h in Headers */,
5D15E3AC0F9E6AC1009E0E3F /* XMLDocumentParserScope.h in Headers */,
......@@ -2432,7 +2432,7 @@ VisiblePositionRange AccessibilityRenderObject::visiblePositionRangeForLine(unsi
// will be a caret at visiblePos.
SelectionController selection;
selection.setSelection(VisibleSelection(visiblePos));
selection.modify(SelectionController::AlterationExtend, SelectionController::DirectionRight, LineBoundary);
selection.modify(SelectionController::AlterationExtend, DirectionRight, LineBoundary);
return VisiblePositionRange(selection.selection().visibleStart(), selection.selection().visibleEnd());
}
......
......@@ -33,6 +33,7 @@
#include "Document.h"
#include "Position.h"
#include "WritingDirection.h"
namespace WebCore {
......@@ -40,8 +41,6 @@ class CSSStyleDeclaration;
class CSSComputedStyleDeclaration;
class CSSMutableStyleDeclaration;
enum WritingDirection { NaturalWritingDirection, LeftToRightWritingDirection, RightToLeftWritingDirection };
class EditingStyle : public RefCounted<EditingStyle> {
public:
......
......@@ -312,7 +312,7 @@ bool Editor::isSelectTrailingWhitespaceEnabled()
return client() && client()->isSelectTrailingWhitespaceEnabled();
}
bool Editor::deleteWithDirection(SelectionController::EDirection direction, TextGranularity granularity, bool killRing, bool isTypingAction)
bool Editor::deleteWithDirection(SelectionDirection direction, TextGranularity granularity, bool killRing, bool isTypingAction)
{
if (!canEdit())
return false;
......@@ -329,12 +329,12 @@ bool Editor::deleteWithDirection(SelectionController::EDirection direction, Text
}
} else {
switch (direction) {
case SelectionController::DirectionForward:
case SelectionController::DirectionRight:
case DirectionForward:
case DirectionRight:
TypingCommand::forwardDeleteKeyPressed(m_frame->document(), canSmartCopyOrDelete(), granularity, killRing);
break;
case SelectionController::DirectionBackward:
case SelectionController::DirectionLeft:
case DirectionBackward:
case DirectionLeft:
TypingCommand::deleteKeyPressed(m_frame->document(), canSmartCopyOrDelete(), granularity, killRing);
break;
}
......@@ -2125,7 +2125,7 @@ void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart,
// Reset the charet one character further.
frame()->selection()->moveTo(frame()->selection()->end());
frame()->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, CharacterGranularity);
frame()->selection()->modify(SelectionController::AlterationMove, DirectionForward, CharacterGranularity);
}
if (!isGrammarCheckingEnabled())
......@@ -2418,11 +2418,11 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
RefPtr<Range> selectionRange = paragraph.subrange(0, selectionOffset);
m_frame->selection()->moveTo(selectionRange->endPosition(), DOWNSTREAM);
if (adjustSelectionForParagraphBoundaries)
m_frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, CharacterGranularity);
m_frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, CharacterGranularity);
} else {
// If this fails for any reason, the fallback is to go one position beyond the last replacement
m_frame->selection()->moveTo(m_frame->selection()->end());
m_frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, CharacterGranularity);
m_frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, CharacterGranularity);
}
}
}
......
......@@ -29,12 +29,15 @@
#include "ClipboardAccessPolicy.h"
#include "Color.h"
#include "CorrectionPanelInfo.h"
#include "DocumentMarker.h"
#include "EditAction.h"
#include "EditingBehavior.h"
#include "EditorDeleteAction.h"
#include "EditorInsertAction.h"
#include "FindOptions.h"
#include "SelectionController.h"
#include "Timer.h"
#include "VisibleSelection.h"
#include "WritingDirection.h"
#if PLATFORM(MAC) && !defined(__OBJC__)
class NSDictionary;
......@@ -43,6 +46,7 @@ typedef int NSWritingDirection;
namespace WebCore {
class CSSMutableStyleDeclaration;
class CSSStyleDeclaration;
class Clipboard;
class DeleteButtonController;
......@@ -145,7 +149,7 @@ public:
void clearLastEditCommand();
bool deleteWithDirection(SelectionController::EDirection, TextGranularity, bool killRing, bool isTypingAction);
bool deleteWithDirection(SelectionDirection, TextGranularity, bool killRing, bool isTypingAction);
void deleteSelectionWithSmartDelete(bool smartDelete);
bool dispatchCPPEvent(const AtomicString&, ClipboardAccessPolicy);
......
......@@ -327,32 +327,32 @@ static bool executeDelete(Frame* frame, Event*, EditorCommandSource source, cons
static bool executeDeleteBackward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->editor()->deleteWithDirection(SelectionController::DirectionBackward, CharacterGranularity, false, true);
frame->editor()->deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
return true;
}
static bool executeDeleteBackwardByDecomposingPreviousCharacter(Frame* frame, Event*, EditorCommandSource, const String&)
{
LOG_ERROR("DeleteBackwardByDecomposingPreviousCharacter is not implemented, doing DeleteBackward instead");
frame->editor()->deleteWithDirection(SelectionController::DirectionBackward, CharacterGranularity, false, true);
frame->editor()->deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
return true;
}
static bool executeDeleteForward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->editor()->deleteWithDirection(SelectionController::DirectionForward, CharacterGranularity, false, true);
frame->editor()->deleteWithDirection(DirectionForward, CharacterGranularity, false, true);
return true;
}
static bool executeDeleteToBeginningOfLine(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->editor()->deleteWithDirection(SelectionController::DirectionBackward, LineBoundary, true, false);
frame->editor()->deleteWithDirection(DirectionBackward, LineBoundary, true, false);
return true;
}
static bool executeDeleteToBeginningOfParagraph(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->editor()->deleteWithDirection(SelectionController::DirectionBackward, ParagraphBoundary, true, false);
frame->editor()->deleteWithDirection(DirectionBackward, ParagraphBoundary, true, false);
return true;
}
......@@ -360,7 +360,7 @@ static bool executeDeleteToEndOfLine(Frame* frame, Event*, EditorCommandSource,
{
// Despite its name, this command should delete the newline at the end of
// a paragraph if you are at the end of a paragraph (like DeleteToEndOfParagraph).
frame->editor()->deleteWithDirection(SelectionController::DirectionForward, LineBoundary, true, false);
frame->editor()->deleteWithDirection(DirectionForward, LineBoundary, true, false);
return true;
}
......@@ -368,7 +368,7 @@ static bool executeDeleteToEndOfParagraph(Frame* frame, Event*, EditorCommandSou
{
// Despite its name, this command should delete the newline at the end of
// a paragraph if you are at the end of a paragraph.
frame->editor()->deleteWithDirection(SelectionController::DirectionForward, ParagraphBoundary, true, false);
frame->editor()->deleteWithDirection(DirectionForward, ParagraphBoundary, true, false);
return true;
}
......@@ -389,13 +389,13 @@ static bool executeDeleteToMark(Frame* frame, Event*, EditorCommandSource, const
static bool executeDeleteWordBackward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->editor()->deleteWithDirection(SelectionController::DirectionBackward, WordGranularity, true, false);
frame->editor()->deleteWithDirection(DirectionBackward, WordGranularity, true, false);
return true;
}
static bool executeDeleteWordForward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->editor()->deleteWithDirection(SelectionController::DirectionForward, WordGranularity, true, false);
frame->editor()->deleteWithDirection(DirectionForward, WordGranularity, true, false);
return true;
}
......@@ -448,7 +448,7 @@ static bool executeForwardDelete(Frame* frame, Event*, EditorCommandSource sourc
{
switch (source) {
case CommandFromMenuOrKeyBinding:
frame->editor()->deleteWithDirection(SelectionController::DirectionForward, CharacterGranularity, false, true);
frame->editor()->deleteWithDirection(DirectionForward, CharacterGranularity, false, true);
return true;
case CommandFromDOM:
case CommandFromDOMWithUserInterface:
......@@ -606,47 +606,47 @@ static bool executeMakeTextWritingDirectionRightToLeft(Frame* frame, Event*, Edi
static bool executeMoveBackward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionBackward, CharacterGranularity, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionBackward, CharacterGranularity, true);
return true;
}
static bool executeMoveBackwardAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, CharacterGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, CharacterGranularity, true);
return true;
}
static bool executeMoveDown(Frame* frame, Event*, EditorCommandSource, const String&)
{
return frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, LineGranularity, true);
return frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, LineGranularity, true);
}
static bool executeMoveDownAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, LineGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, LineGranularity, true);
return true;
}
static bool executeMoveForward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, CharacterGranularity, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, CharacterGranularity, true);
return true;
}
static bool executeMoveForwardAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, CharacterGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, CharacterGranularity, true);
return true;
}
static bool executeMoveLeft(Frame* frame, Event*, EditorCommandSource, const String&)
{
return frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionLeft, CharacterGranularity, true);
return frame->selection()->modify(SelectionController::AlterationMove, DirectionLeft, CharacterGranularity, true);
}
static bool executeMoveLeftAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionLeft, CharacterGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionLeft, CharacterGranularity, true);
return true;
}
......@@ -684,203 +684,203 @@ static bool executeMovePageUpAndModifySelection(Frame* frame, Event*, EditorComm
static bool executeMoveRight(Frame* frame, Event*, EditorCommandSource, const String&)
{
return frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionRight, CharacterGranularity, true);
return frame->selection()->modify(SelectionController::AlterationMove, DirectionRight, CharacterGranularity, true);
}
static bool executeMoveRightAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionRight, CharacterGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionRight, CharacterGranularity, true);
return true;
}
static bool executeMoveToBeginningOfDocument(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionBackward, DocumentBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionBackward, DocumentBoundary, true);
return true;
}
static bool executeMoveToBeginningOfDocumentAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, DocumentBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, DocumentBoundary, true);
return true;
}
static bool executeMoveToBeginningOfLine(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionBackward, LineBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionBackward, LineBoundary, true);
return true;
}
static bool executeMoveToBeginningOfLineAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, LineBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, LineBoundary, true);
return true;
}
static bool executeMoveToBeginningOfParagraph(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionBackward, ParagraphBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionBackward, ParagraphBoundary, true);
return true;
}
static bool executeMoveToBeginningOfParagraphAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, ParagraphBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, ParagraphBoundary, true);
return true;
}
static bool executeMoveToBeginningOfSentence(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionBackward, SentenceBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionBackward, SentenceBoundary, true);
return true;
}
static bool executeMoveToBeginningOfSentenceAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, SentenceBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, SentenceBoundary, true);
return true;
}
static bool executeMoveToEndOfDocument(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, DocumentBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, DocumentBoundary, true);
return true;
}
static bool executeMoveToEndOfDocumentAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, DocumentBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, DocumentBoundary, true);
return true;
}
static bool executeMoveToEndOfSentence(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, SentenceBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, SentenceBoundary, true);
return true;
}
static bool executeMoveToEndOfSentenceAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, SentenceBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, SentenceBoundary, true);
return true;
}
static bool executeMoveToEndOfLine(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, LineBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, LineBoundary, true);
return true;
}
static bool executeMoveToEndOfLineAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, LineBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, LineBoundary, true);
return true;
}
static bool executeMoveToEndOfParagraph(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, ParagraphBoundary, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, ParagraphBoundary, true);
return true;
}
static bool executeMoveToEndOfParagraphAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, ParagraphBoundary, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, ParagraphBoundary, true);
return true;
}
static bool executeMoveParagraphBackwardAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, ParagraphGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, ParagraphGranularity, true);
return true;
}
static bool executeMoveParagraphForwardAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, ParagraphGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, ParagraphGranularity, true);
return true;
}
static bool executeMoveUp(Frame* frame, Event*, EditorCommandSource, const String&)
{
return frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionBackward, LineGranularity, true);
return frame->selection()->modify(SelectionController::AlterationMove, DirectionBackward, LineGranularity, true);
}
static bool executeMoveUpAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, LineGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, LineGranularity, true);
return true;
}
static bool executeMoveWordBackward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionBackward, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionBackward, WordGranularity, true);
return true;
}
static bool executeMoveWordBackwardAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionBackward, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionBackward, WordGranularity, true);
return true;
}
static bool executeMoveWordForward(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionForward, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionForward, WordGranularity, true);
return true;
}
static bool executeMoveWordForwardAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionForward, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionForward, WordGranularity, true);
return true;
}
static bool executeMoveWordLeft(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionLeft, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionLeft, WordGranularity, true);
return true;
}
static bool executeMoveWordLeftAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionLeft, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionLeft, WordGranularity, true);
return true;
}
static bool executeMoveWordRight(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationMove, SelectionController::DirectionRight, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationMove, DirectionRight, WordGranularity, true);
return true;
}
static bool executeMoveWordRightAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&)
{
frame->selection()->modify(SelectionController::AlterationExtend, SelectionController::DirectionRight, WordGranularity, true);
frame->selection()->modify(SelectionController::AlterationExtend, DirectionRight, WordGranularity, true);
return true;
}
static bool executeMoveToLeftEndOfLine(Frame* frame, Event*, EditorCommandSource, const String&)
{