Fix inconsistent text selection behavior with option-shift-left/right/up/down.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 02:51:04 +0000 (02:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 02:51:04 +0000 (02:51 +0000)
commit43054cea2b4bf607441088d80a03541c7f65a9e4
treeff74243121a4ce56ce7318ed2070e4789f6c0e99
parent21468d85e860806390f9b2f9d3411c8e77e871e0
Fix inconsistent text selection behavior with option-shift-left/right/up/down.
https://bugs.webkit.org/show_bug.cgi?id=75652

Patch by Pablo Flouret <pablof@motorola.com> on 2012-01-19
Reviewed by Enrica Casucci.

On Mac, selecting backwards by word, line or paragraph from the middle
of some text, and then going forward leaves the caret back in the middle
with no selection, instead of directly selecting to the other end of the
word/line/paragraph (Unix/Windows behavior). Fix this by adding a new
editing behavior to control whether the selection should go across the
initial position of the caret directly or not in situations like the one
outlined above.

Source/WebCore:

Test: editing/selection/selection-extend-should-not-move-across-caret-on-mac.html

* editing/EditingBehavior.h:
(WebCore::EditingBehavior::shouldExtendSelectionByWordOrLineAcrossCaret):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modify):

LayoutTests:

* editing/selection/selection-extend-should-not-move-across-caret-on-mac-expected.txt: Added.
* editing/selection/selection-extend-should-not-move-across-caret-on-mac.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/selection-extend-should-not-move-across-caret-on-mac-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/selection-extend-should-not-move-across-caret-on-mac.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/EditingBehavior.h
Source/WebCore/editing/FrameSelection.cpp