|
Handle newCursorPosition correctly for Android's commitText()
Android’s InputConnection API specifies a way to commit (confirm) the
current composition and move the cursor at the same time:
https://developer.android.com/reference/android/view/inputmethod/
InputConnection.html#commitText(java.lang.CharSequence, int)
Currently, commitText doesn't conform to the documentation nor to
Android TextView's behavior when newCursorPosition is not 1.
newCursorPosition
is a relative value that depends on the location of the text being committed.
When |newCursorPosition| < 1, the cursor should move to the left of
the committing text by |newCursorPosition| characters. If the cursor
exceeds the left boundary, it will clamp to the left boundary.
When |newCursorPosition| >= 1, the cursor will move to the right of
the committing text by |newCursorPosition - 1| characters. If the cursor
exceeds the right boundary, it will clamp to the right boundary.
(Rebased version of yabinh@'s http://crrev.com/1995333002 which received
lgt'ms from TBRed reviewers below, I'm landing this on his behalf.)
TBR=tkent,yosin,changwan,sievers,yabinh
NOTRY=true
BUG= 570920
Committed: https://crrev.com/87b8f7c3fc3e5bbcc9601023df0fe79cb79234e8
Cr-Commit-Position: refs/heads/master@{#418475}
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+818 lines, -372 lines) |
Patch |
 |
M |
components/test_runner/text_input_controller.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
components/test_runner/web_widget_test_client.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/browser_plugin/browser_plugin_guest.h
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
content/browser/browser_plugin/browser_plugin_guest.cc
|
View
|
|
2 chunks |
+15 lines, -10 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/ime_adapter_android.h
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/ime_adapter_android.cc
|
View
|
|
3 chunks |
+18 lines, -9 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_impl.h
|
View
|
|
1 chunk |
+14 lines, -5 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_impl.cc
|
View
|
|
1 chunk |
+9 lines, -6 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_aura.cc
|
View
|
|
3 chunks |
+7 lines, -6 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
|
View
|
|
4 chunks |
+21 lines, -8 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_mac.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_mac.mm
|
View
|
|
8 chunks |
+11 lines, -15 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
|
View
|
|
5 chunks |
+20 lines, -21 lines |
0 comments
|
Download
|
 |
M |
content/common/browser_plugin/browser_plugin_messages.h
|
View
|
|
1 chunk |
+7 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/common/input_messages.h
|
View
|
|
1 chunk |
+7 lines, -3 lines |
0 comments
|
Download
|
 |
M |
content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
|
View
|
|
3 chunks |
+59 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/renderer/browser_plugin/browser_plugin.h
|
View
|
|
1 chunk |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
content/renderer/browser_plugin/browser_plugin.cc
|
View
|
|
1 chunk |
+15 lines, -8 lines |
0 comments
|
Download
|
 |
M |
content/renderer/pepper/pepper_plugin_instance_impl.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
content/renderer/render_frame_impl.h
|
View
|
|
2 chunks |
+8 lines, -5 lines |
0 comments
|
Download
|
 |
M |
content/renderer/render_frame_impl.cc
|
View
|
1
2
|
3 chunks |
+52 lines, -23 lines |
0 comments
|
Download
|
 |
M |
content/renderer/render_view_browsertest.cc
|
View
|
|
7 chunks |
+52 lines, -53 lines |
0 comments
|
Download
|
 |
M |
content/renderer/render_widget.h
|
View
|
|
1 chunk |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
content/renderer/render_widget.cc
|
View
|
|
4 chunks |
+30 lines, -13 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/InputMethodController.h
|
View
|
|
2 chunks |
+25 lines, -9 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/InputMethodController.cpp
|
View
|
1
|
5 chunks |
+82 lines, -31 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
|
View
|
|
8 chunks |
+26 lines, -26 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebFrameWidgetImpl.h
|
View
|
|
2 chunks |
+2 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
|
View
|
|
2 chunks |
+12 lines, -15 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebLocalFrameImpl.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
|
View
|
|
1 chunk |
+0 lines, -13 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebViewFrameWidget.h
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebViewFrameWidget.cpp
|
View
|
|
1 chunk |
+4 lines, -9 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebViewImpl.h
|
View
|
|
2 chunks |
+2 lines, -5 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/WebViewImpl.cpp
|
View
|
|
2 chunks |
+12 lines, -14 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/Source/web/tests/WebViewTest.cpp
|
View
|
|
15 chunks |
+262 lines, -15 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/public/web/WebLocalFrame.h
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/public/web/WebPlugin.h
|
View
|
|
2 chunks |
+10 lines, -4 lines |
0 comments
|
Download
|
 |
M |
third_party/WebKit/public/web/WebView.h
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
third_party/WebKit/public/web/WebWidget.h
|
View
|
|
1 chunk |
+6 lines, -12 lines |
0 comments
|
Download
|
Total messages: 22 (18 generated)
|