New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601707 link

Starred by 7 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Words duplicated holding backspace with Android Keyboard 5.0

Project Member Reported by changwan@chromium.org, Apr 8 2016

Issue description

Repro steps:

1. Go to google.com
2. Type 'hello world'
3. Move the cursor to the start of 'world'.
4. Call the following InputConnection methods.

beginBatchEdit()
finishComposingText()
deleteSurroundingText(0, 5)
commitText('"', 1)
commitText('world', 1)
setSelection(7, 7)
setComposingText('', 1)
endBatchEdit()


Expected result:
The cursor should be moved to 7.

Actual result:
The cursor is sometimes moved to 12.

I suspect that this happens because
setSelection() is applied earlier than the original order because
it's a frame message and the rest are input messages, and they go to different message loops.


Originally reported at b/27962445. Copied the priority from the original bug.


 
Ok, this is more complicated than I initially thought. The order of messages sent from ime_adapter_android to RenderViewImpl and RenderFrameImpl sometimes gets reversed. This remains the same even when I change some messages from FrameMsg to InputMsg type.

I had to dig quite a lot to figure this out.

We add InputEventFilter in RenderThreadImpl::InitializeCompositorThread() to ensure that input messages are posted to the compositor thread first.

But RenderViewImpl is the only one who calls InputHandlerManager::AddInputHandler() which in turn will call InputEventFilter::DidAddInputHandler() to register the routing ID. Only when it's registered, InputEventFilter will post messages to compositor thread.

Therefore, RenderFrameImpl DOES NOT post input messages to compositor thread while RenderViewImpl DOES. And this explains why the order got reversed.

Some approaches I can think of here:
1) Move InputMsg handling from RenderFrameImpl to RenderWidget
2) Register RenderFrameImpl as input handler.

I'm afraid that the first one would be a huge change, I'll check if 2) is a viable solution.

3) Lift the routing id check. There are multiple places that handles InputMsg: 

https://cs.corp.google.com/search/?q=%22IPC_MESSAGE_HANDLER(InputMsg_%22&sq=package:%5Eclankium$&type=cs

2) and 3) can help keep the input message order along with composition message order.

Comment 3 by aelias@chromium.org, Apr 12 2016

Approach 2 sounds fine to me, it sounds like a simple and safe approach.
Thanks. Uploaded https://codereview.chromium.org/1877073003/ for review.

Comment 5 Deleted

Comment 6 Deleted

Comment 7 Deleted

Components: -IO>Keyboard UI>Input>Text>IME
Labels: -M-51 -merge-merged-2743 M-53
Cc: changwan@chromium.org
 Issue 616614  has been merged into this issue.
Cc: siev...@chromium.org
Labels: -M-53 ReleaseBlock-Stable M-52
Summary: Words duplicated holding backspace with Android Keyboard 5.0 (was: The order of setSelection() and commitText() should be kept)
merging from  issue 616614 .

This is quite a serious issue, and needs to be merged to M52.
screenrecord-20160601_123720.mp4
832 KB View Download
Project Member

Comment 11 by bugdroid1@chromium.org, Jun 13 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d659e20ed5d564cca67934147b481a32a59f3f6a

commit d659e20ed5d564cca67934147b481a32a59f3f6a
Author: changwan <changwan@chromium.org>
Date: Mon Jun 13 02:39:12 2016

Respect the order of input messages from browser to renderer

When we call InputConnection#setSelection and other methods together,
the order sometimes does not get kept. The reason is that
SetEditableSelectionOffsets is a frame message while all the others are
input messages, and they go to different message queues.

In addition, RenderViewImpl is the only who registers its routing ID
through InputHandlerManager::AddInputHandler() call. RenderFrameImpl,
on the other hand, does not register itself.

Once routing ID is registered, InputEventFilter will post input messages to
compositor impl thread first (such that scrolling can happen inside
compositor impl thread and keep in line with other input message handling
order).

We fix this by
1) Changing SetEditableSelectionOffsets from FrameMsg to InputMsg.
  (Now there is no remaining frame messages in ime_adapter_android.cc.)
2) Change DidAddInputHandler() and DidRemoveInputHandler() names to
  RegisterRoutingID() and UnregisterRoutingID(), respectively.
3) Register RenderFrame's routing ID at InputEventFilter.

BUG= 601707 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/1877073003
Cr-Commit-Position: refs/heads/master@{#399404}

[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/browser/frame_host/interstitial_page_impl_browsertest.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/browser/renderer_host/ime_adapter_android.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/common/frame_messages.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/common/input_messages.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/public/renderer/render_view.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_event_filter.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_event_filter.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_event_filter_unittest.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_handler_manager.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_handler_manager.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_handler_manager_client.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/mus/compositor_mus_connection_unittest.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/render_view_impl.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/render_view_impl.h

Labels: Merge-Request-52
requesting approval for merge of #11 to m52

Comment 13 by tin...@google.com, Jun 13 2016

Labels: -Merge-Request-52 Merge-Approved-52 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M52 (branch: 2743)
Project Member

Comment 14 by bugdroid1@chromium.org, Jun 13 2016

Labels: -merge-approved-52 merge-merged-2743
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17ab5a827acb2ae1dbf1a53181d0dd09a0769766

commit 17ab5a827acb2ae1dbf1a53181d0dd09a0769766
Author: Changwan Ryu <changwan@google.com>
Date: Mon Jun 13 03:29:59 2016

Respect the order of input messages from browser to renderer

When we call InputConnection#setSelection and other methods together,
the order sometimes does not get kept. The reason is that
SetEditableSelectionOffsets is a frame message while all the others are
input messages, and they go to different message queues.

In addition, RenderViewImpl is the only who registers its routing ID
through InputHandlerManager::AddInputHandler() call. RenderFrameImpl,
on the other hand, does not register itself.

Once routing ID is registered, InputEventFilter will post input messages to
compositor impl thread first (such that scrolling can happen inside
compositor impl thread and keep in line with other input message handling
order).

We fix this by
1) Changing SetEditableSelectionOffsets from FrameMsg to InputMsg.
  (Now there is no remaining frame messages in ime_adapter_android.cc.)
2) Change DidAddInputHandler() and DidRemoveInputHandler() names to
  RegisterRoutingID() and UnregisterRoutingID(), respectively.
3) Register RenderFrame's routing ID at InputEventFilter.

BUG= 601707 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/1877073003
Cr-Commit-Position: refs/heads/master@{#399404}
(cherry picked from commit d659e20ed5d564cca67934147b481a32a59f3f6a)

Review URL: https://codereview.chromium.org/2060713002 .

Cr-Commit-Position: refs/branch-heads/2743@{#330}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/browser/frame_host/interstitial_page_impl_browsertest.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/browser/renderer_host/ime_adapter_android.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/common/frame_messages.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/common/input_messages.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/public/renderer/render_view.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_event_filter.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_event_filter.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_event_filter_unittest.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_handler_manager.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_handler_manager.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_handler_manager_client.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/mus/compositor_mus_connection_unittest.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/render_view_impl.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/render_view_impl.h

Status: Fixed (was: Assigned)
Project Member

Comment 16 by bugdroid1@chromium.org, Jun 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/18119df9699c07cd83d99f282b8d152fcf423b86

commit 18119df9699c07cd83d99f282b8d152fcf423b86
Author: Alex Mineer <amineer@chromium.org>
Date: Tue Jun 14 16:51:47 2016

Revert "Respect the order of input messages from browser to renderer"

This reverts commit 17ab5a827acb2ae1dbf1a53181d0dd09a0769766.

Causing build failures.

BUG=619820, 601707 

Cr-Commit-Position: refs/branch-heads/2743@{#350}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/browser/frame_host/interstitial_page_impl_browsertest.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/browser/renderer_host/ime_adapter_android.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/common/frame_messages.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/common/input_messages.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/public/renderer/render_view.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_event_filter.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_event_filter.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_event_filter_unittest.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_handler_manager.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_handler_manager.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_handler_manager_client.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/mus/compositor_mus_connection_unittest.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/render_view_impl.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/render_view_impl.h

Status: Assigned (was: Fixed)
Build error on M52 branch was:

In file included from ../../content/renderer/android/synchronous_compositor_filter.cc:5:0:
../../content/renderer/android/synchronous_compositor_filter.h:65:8: error: 'void content::SynchronousCompositorFilter::DidAddInputHandler(int)' marked override, but does not override
   void DidAddInputHandler(int routing_id) override;
        ^
../../content/renderer/android/synchronous_compositor_filter.h:66:8: error: 'void content::SynchronousCompositorFilter::DidRemoveInputHandler(int)' marked override, but does not override
   void DidRemoveInputHandler(int routing_id) override;
        ^
Project Member

Comment 18 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d659e20ed5d564cca67934147b481a32a59f3f6a

commit d659e20ed5d564cca67934147b481a32a59f3f6a
Author: changwan <changwan@chromium.org>
Date: Mon Jun 13 02:39:12 2016

Respect the order of input messages from browser to renderer

When we call InputConnection#setSelection and other methods together,
the order sometimes does not get kept. The reason is that
SetEditableSelectionOffsets is a frame message while all the others are
input messages, and they go to different message queues.

In addition, RenderViewImpl is the only who registers its routing ID
through InputHandlerManager::AddInputHandler() call. RenderFrameImpl,
on the other hand, does not register itself.

Once routing ID is registered, InputEventFilter will post input messages to
compositor impl thread first (such that scrolling can happen inside
compositor impl thread and keep in line with other input message handling
order).

We fix this by
1) Changing SetEditableSelectionOffsets from FrameMsg to InputMsg.
  (Now there is no remaining frame messages in ime_adapter_android.cc.)
2) Change DidAddInputHandler() and DidRemoveInputHandler() names to
  RegisterRoutingID() and UnregisterRoutingID(), respectively.
3) Register RenderFrame's routing ID at InputEventFilter.

BUG= 601707 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/1877073003
Cr-Commit-Position: refs/heads/master@{#399404}

[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/browser/frame_host/interstitial_page_impl_browsertest.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/browser/renderer_host/ime_adapter_android.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/common/frame_messages.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/common/input_messages.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/public/renderer/render_view.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_event_filter.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_event_filter.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_event_filter_unittest.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_handler_manager.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_handler_manager.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/input/input_handler_manager_client.h
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/mus/compositor_mus_connection_unittest.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/render_view_impl.cc
[modify] https://crrev.com/d659e20ed5d564cca67934147b481a32a59f3f6a/content/renderer/render_view_impl.h

Project Member

Comment 19 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17ab5a827acb2ae1dbf1a53181d0dd09a0769766

commit 17ab5a827acb2ae1dbf1a53181d0dd09a0769766
Author: Changwan Ryu <changwan@google.com>
Date: Mon Jun 13 03:29:59 2016

Respect the order of input messages from browser to renderer

When we call InputConnection#setSelection and other methods together,
the order sometimes does not get kept. The reason is that
SetEditableSelectionOffsets is a frame message while all the others are
input messages, and they go to different message queues.

In addition, RenderViewImpl is the only who registers its routing ID
through InputHandlerManager::AddInputHandler() call. RenderFrameImpl,
on the other hand, does not register itself.

Once routing ID is registered, InputEventFilter will post input messages to
compositor impl thread first (such that scrolling can happen inside
compositor impl thread and keep in line with other input message handling
order).

We fix this by
1) Changing SetEditableSelectionOffsets from FrameMsg to InputMsg.
  (Now there is no remaining frame messages in ime_adapter_android.cc.)
2) Change DidAddInputHandler() and DidRemoveInputHandler() names to
  RegisterRoutingID() and UnregisterRoutingID(), respectively.
3) Register RenderFrame's routing ID at InputEventFilter.

BUG= 601707 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/1877073003
Cr-Commit-Position: refs/heads/master@{#399404}
(cherry picked from commit d659e20ed5d564cca67934147b481a32a59f3f6a)

Review URL: https://codereview.chromium.org/2060713002 .

Cr-Commit-Position: refs/branch-heads/2743@{#330}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/browser/frame_host/interstitial_page_impl_browsertest.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/browser/renderer_host/ime_adapter_android.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/common/frame_messages.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/common/input_messages.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/public/renderer/render_view.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_event_filter.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_event_filter.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_event_filter_unittest.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_handler_manager.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_handler_manager.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/input/input_handler_manager_client.h
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/mus/compositor_mus_connection_unittest.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/render_view_impl.cc
[modify] https://crrev.com/17ab5a827acb2ae1dbf1a53181d0dd09a0769766/content/renderer/render_view_impl.h

Project Member

Comment 20 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/18119df9699c07cd83d99f282b8d152fcf423b86

commit 18119df9699c07cd83d99f282b8d152fcf423b86
Author: Alex Mineer <amineer@chromium.org>
Date: Tue Jun 14 16:51:47 2016

Revert "Respect the order of input messages from browser to renderer"

This reverts commit 17ab5a827acb2ae1dbf1a53181d0dd09a0769766.

Causing build failures.

BUG=619820, 601707 

Cr-Commit-Position: refs/branch-heads/2743@{#350}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/browser/frame_host/interstitial_page_impl_browsertest.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/browser/renderer_host/ime_adapter_android.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/common/frame_messages.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/common/input_messages.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/public/renderer/render_view.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_event_filter.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_event_filter.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_event_filter_unittest.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_handler_manager.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_handler_manager.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/input/input_handler_manager_client.h
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/mus/compositor_mus_connection_unittest.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/render_view_impl.cc
[modify] https://crrev.com/18119df9699c07cd83d99f282b8d152fcf423b86/content/renderer/render_view_impl.h

Project Member

Comment 21 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/42474c963954249daf54aa0a12c5b0247a70a269

commit 42474c963954249daf54aa0a12c5b0247a70a269
Author: Changwan Ryu <changwan@google.com>
Date: Wed Jun 15 03:00:19 2016

Reland "Respect the order of input messages from browser to renderer"

Fixed build error.
>>
When we call InputConnection#setSelection and other methods together,
the order sometimes does not get kept. The reason is that
SetEditableSelectionOffsets is a frame message while all the others are
input messages, and they go to different message queues.

In addition, RenderViewImpl is the only who registers its routing ID
through InputHandlerManager::AddInputHandler() call. RenderFrameImpl,
on the other hand, does not register itself.

Once routing ID is registered, InputEventFilter will post input messages to
compositor impl thread first (such that scrolling can happen inside
compositor impl thread and keep in line with other input message handling
order).

We fix this by
1) Changing SetEditableSelectionOffsets from FrameMsg to InputMsg.
  (Now there is no remaining frame messages in ime_adapter_android.cc.)
2) Change DidAddInputHandler() and DidRemoveInputHandler() names to
  RegisterRoutingID() and UnregisterRoutingID(), respectively.
3) Register RenderFrame's routing ID at InputEventFilter.

BUG= 601707 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/1877073003
Cr-Commit-Position: refs/heads/master@{#399404}
(cherry picked from commit d659e20ed5d564cca67934147b481a32a59f3f6a)

Review URL: https://codereview.chromium.org/2060713002 .

Review URL: https://codereview.chromium.org/2065333002 .

Cr-Original-Commit-Position: refs/branch-heads/2743@{#330}
Cr-Original-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}
Cr-Commit-Position: refs/branch-heads/2743@{#362}
Cr-Branched-From: 2b3ae3b8090361f8af5a611712fc1a5ab2de53cb-refs/heads/master@{#394939}

[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/browser/frame_host/interstitial_page_impl_browsertest.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/browser/renderer_host/ime_adapter_android.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/common/frame_messages.h
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/common/input_messages.h
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/public/renderer/render_view.h
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/android/synchronous_compositor_filter.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/android/synchronous_compositor_filter.h
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/input/input_event_filter.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/input/input_event_filter.h
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/input/input_event_filter_unittest.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/input/input_handler_manager.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/input/input_handler_manager.h
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/input/input_handler_manager_client.h
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/mus/compositor_mus_connection_unittest.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/render_frame_impl.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/render_view_impl.cc
[modify] https://crrev.com/42474c963954249daf54aa0a12c5b0247a70a269/content/renderer/render_view_impl.h

Status: Fixed (was: Assigned)
Issue 598307 has been merged into this issue.
Hello,

I've read all of your comments above but I can't resolve my issue.
(Please take a look at attached video)
I've developed a customized keyboard.
As you can see, it has a tool bar and the first button is to invert the capitalization of focused word. (In the video, "my" => "MY")
But the result is "MYmy" instead of "MY".

Related codes are 
// Let's assume that wordStart, wordEnd were already calculated.
void replaceText(InputConnection ic, int wordStart, int wordEnd, String replace) {
    ic.setSelection(wordStart, wordEnd);
    ic.commitText(replace, 1);
}

Please help.
Thanks
keybo-171.mp4
420 KB View Download

Sign in to add a comment