From 7fda933a53929082a57fe052da1a730561c97957 Mon Sep 17 00:00:00 2001 From: "darin@apple.com" Date: Wed, 18 Mar 2009 00:42:24 +0000 Subject: [PATCH] WebCore: 2009-03-17 Darin Adler Reviewed by Adele Peterson. Need support for new move-left/right selectors. * editing/EditorCommand.cpp: (WebCore::executeMoveToLeftEndOfLine): Added. (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Added. (WebCore::executeMoveToRightEndOfLine): Added. (WebCore::executeMoveToRightEndOfLineAndModifySelection): Added. Added command entries for the functions above. WebKit/mac: 2009-03-17 Darin Adler Reviewed by Adele Peterson. Need support for new move-left/right selectors. * WebView/WebHTMLView.mm: Added the four new selectors to the command-forwarding list. * WebView/WebView.mm: Ditto. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41794 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog | 13 +++++++++++++ WebCore/editing/EditorCommand.cpp | 30 +++++++++++++++++++++++++++++- WebKit/mac/ChangeLog | 9 +++++++++ WebKit/mac/WebView/WebHTMLView.mm | 4 ++++ WebKit/mac/WebView/WebView.mm | 4 ++++ 5 files changed, 59 insertions(+), 1 deletion(-) diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index c701f7d..44ed4e9 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,16 @@ +2009-03-17 Darin Adler + + Reviewed by Adele Peterson. + + Need support for new move-left/right selectors. + + * editing/EditorCommand.cpp: + (WebCore::executeMoveToLeftEndOfLine): Added. + (WebCore::executeMoveToLeftEndOfLineAndModifySelection): Added. + (WebCore::executeMoveToRightEndOfLine): Added. + (WebCore::executeMoveToRightEndOfLineAndModifySelection): Added. + Added command entries for the functions above. + 2009-03-17 Ojan Vafai Reviewed by Adele Peterson. diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp index a22196c..0090df7 100644 --- a/WebCore/editing/EditorCommand.cpp +++ b/WebCore/editing/EditorCommand.cpp @@ -827,6 +827,30 @@ static bool executeMoveWordRightAndModifySelection(Frame* frame, Event*, EditorC return true; } +static bool executeMoveToLeftEndOfLine(Frame* frame, Event*, EditorCommandSource, const String&) +{ + frame->selection()->modify(SelectionController::MOVE, SelectionController::LEFT, LineBoundary, true); + return true; +} + +static bool executeMoveToLeftEndOfLineAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&) +{ + frame->selection()->modify(SelectionController::EXTEND, SelectionController::LEFT, LineBoundary, true); + return true; +} + +static bool executeMoveToRightEndOfLine(Frame* frame, Event*, EditorCommandSource, const String&) +{ + frame->selection()->modify(SelectionController::MOVE, SelectionController::RIGHT, LineBoundary, true); + return true; +} + +static bool executeMoveToRightEndOfLineAndModifySelection(Frame* frame, Event*, EditorCommandSource, const String&) +{ + frame->selection()->modify(SelectionController::EXTEND, SelectionController::RIGHT, LineBoundary, true); + return true; +} + static bool executeOutdent(Frame* frame, Event*, EditorCommandSource, const String&) { applyCommand(IndentOutdentCommand::create(frame->document(), IndentOutdentCommand::Outdent)); @@ -1259,8 +1283,8 @@ static const CommandMap& createCommandMap() { "IgnoreSpelling", { executeIgnoreSpelling, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "Indent", { executeIndent, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "InsertBacktab", { executeInsertBacktab, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, isTextInsertion, doNotAllowExecutionWhenDisabled } }, - { "InsertHorizontalRule", { executeInsertHorizontalRule, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "InsertHTML", { executeInsertHTML, supported, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, + { "InsertHorizontalRule", { executeInsertHorizontalRule, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "InsertImage", { executeInsertImage, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "InsertLineBreak", { executeInsertLineBreak, supported, enabledInEditableText, stateNone, valueNull, isTextInsertion, doNotAllowExecutionWhenDisabled } }, { "InsertNewline", { executeInsertNewline, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, isTextInsertion, doNotAllowExecutionWhenDisabled } }, @@ -1311,6 +1335,10 @@ static const CommandMap& createCommandMap() { "MoveToEndOfParagraphAndModifySelection", { executeMoveToEndOfParagraphAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "MoveToEndOfSentence", { executeMoveToEndOfSentence, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "MoveToEndOfSentenceAndModifySelection", { executeMoveToEndOfSentenceAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, + { "MoveToLeftEndOfLine", { executeMoveToLeftEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, + { "MoveToLeftEndOfLineAndModifySelection", { executeMoveToLeftEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, + { "MoveToRightEndOfLine", { executeMoveToRightEndOfLine, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, + { "MoveToRightEndOfLineAndModifySelection", { executeMoveToRightEndOfLineAndModifySelection, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "MoveUp", { executeMoveUp, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "MoveUpAndModifySelection", { executeMoveUpAndModifySelection, supportedFromMenuOrKeyBinding, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, { "MoveWordBackward", { executeMoveWordBackward, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index 92ead93..94a8d82 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -2,6 +2,15 @@ Reviewed by Adele Peterson. + Need support for new move-left/right selectors. + + * WebView/WebHTMLView.mm: Added the four new selectors to the command-forwarding list. + * WebView/WebView.mm: Ditto. + +2009-03-17 Darin Adler + + Reviewed by Adele Peterson. + Bug 24477: REGRESSION (r41467): Page Down key scrolls two pages https://bugs.webkit.org/show_bug.cgi?id=24477 rdar://problem/6674184 diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 5466892..9d38131 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -2396,6 +2396,10 @@ WEBCORE_COMMAND(moveToEndOfParagraph) WEBCORE_COMMAND(moveToEndOfParagraphAndModifySelection) WEBCORE_COMMAND(moveToEndOfSentence) WEBCORE_COMMAND(moveToEndOfSentenceAndModifySelection) +WEBCORE_COMMAND(moveToLeftEndOfLine) +WEBCORE_COMMAND(moveToLeftEndOfLineAndModifySelection) +WEBCORE_COMMAND(moveToRightEndOfLine) +WEBCORE_COMMAND(moveToRightEndOfLineAndModifySelection) WEBCORE_COMMAND(moveUp) WEBCORE_COMMAND(moveUpAndModifySelection) WEBCORE_COMMAND(moveWordBackward) diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index e679a29..8f16bff 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -232,6 +232,10 @@ macro(moveToEndOfParagraph) \ macro(moveToEndOfParagraphAndModifySelection) \ macro(moveToEndOfSentence) \ macro(moveToEndOfSentenceAndModifySelection) \ +macro(moveToLeftEndOfLine) \ +macro(moveToLeftEndOfLineAndModifySelection) \ +macro(moveToRightEndOfLine) \ +macro(moveToRightEndOfLineAndModifySelection) \ macro(moveUp) \ macro(moveUpAndModifySelection) \ macro(moveWordBackward) \ -- 1.8.3.1