New issue
Advanced search Search tips

Issue 723024 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 3
Type: Bug



Sign in to add a comment

RenderWidgetHostImpl::ImeFinishComposingText is called twice in response to mouse event

Project Member Reported by ekaramad@chromium.org, May 16 2017

Issue description

Chrome Version: 60.0.3101.0
OS: Win/Linux

What steps will reproduce the problem?
(1) Enable Japanese IME.
(2) Enter some characters (do not commit).
(3) Click somewhere.

What is the expected result?
One call to RenderWidgetHostImpl::ImeFinishComposingText is made.

What happens instead?
The method is called twice.



For graphics-related bugs, please copy/paste the contents of the about:gpu
page at the end of this report.

 
We need to reset |has_composition_text_| right after calling the method or otherwise in the call to RenderWidgetHostViewBase::ImeCancelComposition we end up calling the method RenderWidgetHostImpl::ImeFinishComposingText again.
Status: Started (was: Assigned)
Labels: OS-Linux OS-Windows
Labels: OS-Chrome
I think actually the right fix is to call: https://cs.chromium.org/chromium/src/content/browser/renderer_host/render_widget_host_view_aura.cc?rcl=4e9fc10cf30e41afad38069847381cd725c2acbe&l=1198

My understanding is that it is never a good idea to call IME methods directly on the RWH. We should always go through the page's RWHV since they are responsible for IME (coordination across widgets on page, internal IME state, etc.).
Incorrect bug number in the CL. Posting manually:
Fix an IME bug where RWHImpl::ImeFinishCompositingText is called twice in a row

When a mouse click is received during an on going IME composition, the
RenderWidgetHostViewEventHandler finishes the composition and also
cancels the composition at the InputMethod side. This is done through
calling ImeFinishComposingText on the focused widget and then notifying
the input method.

This however undermines the fact that
RenderWidgetHostViewAura/TextInputClient keeps track of different IME
states internally, such as |has_composition_text_|. Therefore, the
correct practice should be to route all IME events through
TextInputClient instead (as opposed to sending the IPC directly).

In the case of this bug, calling
RenderWidgetHostImpl::ImeFinishComposingText will not reset the
|has_composition_text_| flag inside RWHVAura and hecne, later calling
ImeCancelComposition (to cancel the composition on the InputMethod side)
will lead to yet another IPC for ImeFinishComposingText.

BUG= 723024 
Review-Url: https://codereview.chromium.org/2912473002
Cr-Commit-Position: refs/heads/master@{#475908}
Committed: https://chromium.googlesource.com/chromium/src/+/428a2f9eb3e0e72bac3ef401fe7e1a13e2009e75
  
Status: Fixed (was: Started)
Marking as fixed based on comment #6.

Sign in to add a comment