Make moveCaretTowardsWindowPoint not snap to the beginning/end when moved above/below...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2013 01:27:25 +0000 (01:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2013 01:27:25 +0000 (01:27 +0000)
commit8516ae0b64c92c87eabcd8e1ab555775d625f1e2
tree86e58b725502d5949651f16139b74a106b400fdf
parent07a6f2e8660648ace0b0a39f010b85bd7e6d2b48
Make moveCaretTowardsWindowPoint not snap to the beginning/end when moved above/below editable
https://bugs.webkit.org/show_bug.cgi?id=107850

Patch by Chris Hopman <cjhopman@chromium.org> on 2013-02-04
Reviewed by Ojan Vafai.

Source/WebCore:

On Android, EditingBehavior::shouldMoveCaret[...] controls the
behavior of insertion handles. This change adds a new Android specific
editing behavior type.

The new EditingBehavior is the same as EditingUnixBehavior except for
EditingBehavior::shouldMoveCaret[...]. This new behavior fixes
WebFrame::moveCaretTowardsWindowPoint to not span to the
beginning/end.

* editing/EditingBehavior.h:
(WebCore::EditingBehavior::shouldMoveCaretToHorizontalBoundaryWhenPastTopOrBottom):
(WebCore::EditingBehavior::shouldAllowSpellingSuggestionsWithoutSelection):
(WebCore::EditingBehavior::shouldNavigateBackOnBackspace):
* editing/EditingBehaviorTypes.h:
* page/Settings.cpp:
(WebCore):
(WebCore::editingBehaviorTypeForPlatform):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setEditingBehavior):

Source/WebKit/chromium:

On Android, EditingBehavior::shouldMoveCaret[...] controls the
behavior of insertion handles. This change adds a new Android specific
editing behavior type so that we can change these settings independent
of behavior for other platforms.

* public/WebSettings.h:
* src/AssertMatchingEnums.cpp:
Just add the corresponding assertion for the new editing behavior.

* public/WebSettings.h:
* src/AssertMatchingEnums.cpp:

* tests/WebFrameTest.cpp:
* tests/data/move_caret.html: Added.
Add a test that moveCaretTowardsWindowPoint works as expected on
Android.

LayoutTests:

Test the new "android" editing behavior in the following tests:

* editing/deleting/delete-ligature-003-expected.txt:
* editing/deleting/delete-ligature-003.html:
* editing/deleting/paragraph-in-preserveNewline-expected.txt:
* editing/deleting/paragraph-in-preserveNewline.html:
* editing/deleting/whitespace-pre-1-expected.txt:
* editing/deleting/whitespace-pre-1.html:
* editing/execCommand/script-tests/toggle-compound-styles.js:
* editing/execCommand/toggle-compound-styles-expected.txt:
* editing/selection/5354455-1-expected.txt:
* editing/selection/5354455-1.html:
* editing/selection/click-in-margins-inside-editable-div-expected.txt:
* editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt:
* editing/selection/context-menu-text-selection-expected.txt:
* editing/selection/context-menu-text-selection.html:
* editing/selection/extend-after-mouse-selection-expected.txt:
* editing/selection/extend-after-mouse-selection.html:
* editing/selection/programmatic-selection-on-mac-is-directionless-expected.txt:
* editing/selection/programmatic-selection-on-mac-is-directionless.html:
* editing/selection/rtl-move-selection-right-left-expected.txt:
* editing/selection/rtl-move-selection-right-left.html:
* editing/selection/script-tests/click-in-margins-inside-editable-div.js:
* editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js:
* editing/selection/selection-extend-should-not-move-across-caret-on-mac-expected.txt:
* editing/selection/selection-extend-should-not-move-across-caret-on-mac.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-ligature-003-expected.txt
LayoutTests/editing/deleting/delete-ligature-003.html
LayoutTests/editing/deleting/paragraph-in-preserveNewline-expected.txt
LayoutTests/editing/deleting/paragraph-in-preserveNewline.html
LayoutTests/editing/deleting/whitespace-pre-1-expected.txt
LayoutTests/editing/deleting/whitespace-pre-1.html
LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
LayoutTests/editing/execCommand/toggle-compound-styles-expected.txt
LayoutTests/editing/selection/5354455-1-expected.txt
LayoutTests/editing/selection/5354455-1.html
LayoutTests/editing/selection/click-in-margins-inside-editable-div-expected.txt
LayoutTests/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt
LayoutTests/editing/selection/context-menu-text-selection-expected.txt
LayoutTests/editing/selection/context-menu-text-selection.html
LayoutTests/editing/selection/extend-after-mouse-selection-expected.txt
LayoutTests/editing/selection/extend-after-mouse-selection.html
LayoutTests/editing/selection/programmatic-selection-on-mac-is-directionless-expected.txt
LayoutTests/editing/selection/programmatic-selection-on-mac-is-directionless.html
LayoutTests/editing/selection/rtl-move-selection-right-left-expected.txt
LayoutTests/editing/selection/rtl-move-selection-right-left.html
LayoutTests/editing/selection/script-tests/click-in-margins-inside-editable-div.js
LayoutTests/editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js
LayoutTests/editing/selection/selection-extend-should-not-move-across-caret-on-mac-expected.txt
LayoutTests/editing/selection/selection-extend-should-not-move-across-caret-on-mac.html
Source/WebCore/ChangeLog
Source/WebCore/editing/EditingBehavior.h
Source/WebCore/editing/EditingBehaviorTypes.h
Source/WebCore/page/Settings.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/AssertMatchingEnums.cpp
Source/WebKit/chromium/tests/WebFrameTest.cpp
Source/WebKit/chromium/tests/data/move_caret.html [new file with mode: 0644]