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)
commit8c06b366847af46cca80107a7c3f4f4de68b51dd
treeff74243121a4ce56ce7318ed2070e4789f6c0e99
parentb4f968354d87deec76e2c7b4e703f7f810e0ad65
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: https://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