Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Issue 2912473002: Fix an IME bug where RWHImpl::ImeFinishCompositingText is called twice in a row (Closed)

Created:
3 years, 7 months ago by EhsanK
Modified:
3 years, 6 months ago
Reviewers:
Shu Chen, sadrul
CC:
chromium-reviews, yusukes+watch_chromium.org, shuchen+watch_chromium.org, jam, nona+watch_chromium.org, darin-cc_chromium.org, James Su
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : Modified the Test #

Total comments: 3

Patch Set 3 : Change EXPECT_EQ => ASSERT_EQ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -14 lines) Patch
M content/browser/renderer_host/render_widget_host_view_aura_unittest.cc View 1 2 1 chunk +5 lines, -8 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_event_handler.cc View 1 chunk +5 lines, -6 lines 0 comments Download

Messages

Total messages: 23 (17 generated)
EhsanK
PTAL. sadrul@: reviewer of the original patch adding the test shuchen@: originally add the logic ...
3 years, 7 months ago (2017-05-26 18:48:48 UTC) #8
sadrul
lgtm But please wait for shuchen@'s approval too. https://codereview.chromium.org/2912473002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc File content/browser/renderer_host/render_widget_host_view_aura_unittest.cc (right): https://codereview.chromium.org/2912473002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc#newcode1584 content/browser/renderer_host/render_widget_host_view_aura_unittest.cc:1584: EXPECT_EQ(InputMsg_ImeFinishComposingText::ID, ...
3 years, 6 months ago (2017-05-30 21:03:03 UTC) #11
Shu Chen
lgtm https://codereview.chromium.org/2912473002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc File content/browser/renderer_host/render_widget_host_view_aura_unittest.cc (right): https://codereview.chromium.org/2912473002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc#newcode1584 content/browser/renderer_host/render_widget_host_view_aura_unittest.cc:1584: EXPECT_EQ(InputMsg_ImeFinishComposingText::ID, On 2017/05/30 21:03:03, sadrul wrote: > ASSERT ...
3 years, 6 months ago (2017-05-31 01:16:36 UTC) #12
EhsanK
Thanks for the reviews! I will CQ soon. https://codereview.chromium.org/2912473002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc File content/browser/renderer_host/render_widget_host_view_aura_unittest.cc (right): https://codereview.chromium.org/2912473002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc#newcode1584 content/browser/renderer_host/render_widget_host_view_aura_unittest.cc:1584: EXPECT_EQ(InputMsg_ImeFinishComposingText::ID, ...
3 years, 6 months ago (2017-05-31 13:48:24 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2912473002/40001
3 years, 6 months ago (2017-05-31 14:12:15 UTC) #19
commit-bot: I haz the power
3 years, 6 months ago (2017-05-31 15:03:07 UTC) #22
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/428a2f9eb3e0e72bac3ef401fe7e...

Powered by Google App Engine
This is Rietveld 408576698