-
justing authored
Reviewed by darin <rdar://problem/5007143> REGRESSION: WebKit doesn't remember horizontal position of caret when moving forward by line Added, tests the removal of the use of the recalc bool from xPosForVerticalArrowNavigation(...): * editing/selection/5007143-2-expected.checksum: Added. * editing/selection/5007143-2-expected.png: Added. * editing/selection/5007143-2-expected.txt: Added. * editing/selection/5007143-2.html: Added. Added, demonstrate the changes to modify: * editing/selection/5007143-expected.checksum: Added. * editing/selection/5007143-expected.png: Added. * editing/selection/5007143-expected.txt: Added. * editing/selection/5007143.html: Added. Demonstrates a bug (filed 5017312): * editing/style/block-style-004-expected.txt: * editing/style/block-style-005-expected.txt: * editing/style/block-style-006-expected.txt: Fixed: * editing/selection/3690703-2-expected.checksum: * editing/selection/3690703-2-expected.png: * editing/selection/3690703-2-expected.txt: * editing/style/create-block-for-style-009-expected.checksum: * editing/style/create-block-for-style-009-expected.png: * editing/style/create-block-for-style-009-expected.txt: * editing/style/create-block-for-style-011-expected.checksum: * editing/style/create-block-for-style-011-expected.png: * editing/style/create-block-for-style-011-expected.txt: WebCore: Reviewed by darin <rdar://problem/5007143> REGRESSION: WebKit doesn't remember horizontal position of caret when moving forward by line * editing/SelectionController.cpp: (WebCore::SelectionController::SelectionController): Initialize m_xPosForVerticalArrowNavigation. (WebCore::SelectionController::setSelection): Call the new setter. (WebCore::SelectionController::modifyMovingRightForward): For line and paragraph granularities, use the saved xPosForVerticalArrowNavigation even if the old selection was a range. Use the x position of the *start*, not the end of the selection if there is no saved xPosForVerticalArrowNavigation. This matches TextEdit's behavior. (WebCore::SelectionController::modifyMovingLeftBackward): For line and paragraph granularities, use the saved xPosForVerticalArrowNavigation even if the old selection was a range. (WebCore::SelectionController::modify): Preserve the xPosForVerticalArrowNavigation for line and paragraph granularities. (WebCore::SelectionController::xPosForVerticalArrowNavigation): Removed the recalc bool because it is now always false. (WebCore::SelectionController::setXPosForVerticalArrowNavigation): Added. * editing/SelectionController.h: Moved m_xPosForVerticalArrowNavigation from Frame. * page/Frame.cpp: Moved m_xPosForVerticalArrowNavigation to SelectionController. * page/Frame.h: Ditto. * page/FramePrivate.h: Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
9c7c499a