Changeset 19463 in webkit
- Timestamp:
- Feb 6, 2007 11:40:59 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r19452 r19463 1 2007-02-06 Alice Liu <alice.liu@apple.com> 2 3 Reviewed by Maciej. 4 5 Added editing command functions for scrolling by page and moving the caret 6 7 * editing/Editor.cpp: 8 (WebCore::execMoveUpByPageAndModifyCaret): 9 (WebCore::execMoveDownByPageAndModifyCaret): 10 (WebCore::CommandEntry::): 11 1 12 2007-02-06 Justin Garcia <justin.garcia@apple.com> 2 13 -
trunk/WebCore/editing/Editor.cpp
r19417 r19463 797 797 } 798 798 799 static bool execMoveUpByPageAndModifyCaret(Frame* frame) 800 { 801 RenderObject* renderer = frame->document()->focusedNode()->renderer(); 802 if (renderer->style()->overflowY() == OSCROLL 803 || renderer->style()->overflowY() == OAUTO 804 || renderer->isTextArea()) { 805 int height = -(frame->document()->focusedNode()->renderer()->clientHeight()-PAGE_KEEP); 806 bool handledScroll = renderer->scroll(ScrollUp, ScrollByPage); 807 bool handledCaretMove = frame->selectionController()->modify(SelectionController::MOVE, height); 808 return handledScroll || handledCaretMove; 809 } 810 return false; 811 } 812 799 813 static bool execMoveDown(Frame* frame) 800 814 { … … 819 833 frame->selectionController()->modify(SelectionController::EXTEND, SelectionController::FORWARD, CharacterGranularity, true); 820 834 return true; 835 } 836 837 static bool execMoveDownByPageAndModifyCaret(Frame* frame) 838 { 839 RenderObject* renderer = frame->document()->focusedNode()->renderer(); 840 if (renderer->style()->overflowY() == OSCROLL 841 || renderer->style()->overflowY() == OAUTO 842 || renderer->isTextArea()) { 843 int height = frame->document()->focusedNode()->renderer()->clientHeight()-PAGE_KEEP; 844 bool handledScroll = renderer->scroll(ScrollDown, ScrollByPage); 845 bool handledCaretMove = frame->selectionController()->modify(SelectionController::MOVE, height); 846 return handledScroll || handledCaretMove; 847 } 848 return false; 821 849 } 822 850 … … 1122 1150 { "MoveBackward", { hasEditableSelection, execMoveBackward } }, 1123 1151 { "MoveBackwardAndModifySelection", { hasEditableSelection, execMoveBackwardAndModifySelection } }, 1152 { "MoveUpByPageAndModifyCaret", { hasEditableSelection, execMoveUpByPageAndModifyCaret } }, 1124 1153 { "MoveDown", { hasEditableSelection, execMoveDown } }, 1125 1154 { "MoveDownAndModifySelection", { hasEditableSelection, execMoveDownAndModifySelection } }, 1126 1155 { "MoveForward", { hasEditableSelection, execMoveForward } }, 1127 1156 { "MoveForwardAndModifySelection", { hasEditableSelection, execMoveForwardAndModifySelection } }, 1157 { "MoveDownByPageAndModifyCaret", { hasEditableSelection, execMoveDownByPageAndModifyCaret } }, 1128 1158 { "MoveLeft", { hasEditableSelection, execMoveLeft } }, 1129 1159 { "MoveLeftAndModifySelection", { hasEditableSelection, execMoveLeftAndModifySelection } },
Note: See TracChangeset
for help on using the changeset viewer.