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

Issue 2171443003: In TextInputManager, reset input type to none before switching active widgets. (Closed)

Created:
4 years, 5 months ago by EhsanK
Modified:
4 years, 4 months ago
Reviewers:
kenrb, Charlie Reis
CC:
chromium-reviews, yusukes+watch_chromium.org, shuchen+watch_chromium.org, jam, nona+watch_chromium.org, darin-cc_chromium.org, James Su, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

In TextInputManager, reset input type to none before switching active widgets. When there are no OOPIFs in a page, if we switch focus from one <input> into another (i.e., through a mouse click), the TextInputState will be first set to NONE and then back to TEXT. This however does not always happen when there are OOPIFs since the two IPCs might arrive from different RenderWidgets and the order of arrival is not deterministic (e.g., the IPC to set to TEXT could arrive sooner). Although TextInputManager tracks the state and active widget correctly (regardless of what order the IPCs arrive from the RenderWidgets), it still does not mimic the exact same behavior as in the single RenderWidget case. In Aura platforms, without setting the TextInputState to none before changing the active widget, the IME behavior might go wrong and InputMethod behave out of sync with the actual TextInputState. The reason is that the InputMethod would believe that the TextInputClient is the same but the IME session has ended. This CL will try to simulate the same behavior for all scenarios by injecting a TextInputState of none in between an active widget change. BUG=626171, 578168, 602723 Committed: https://crrev.com/44c242985f1c9f81dc56e7d5122776250b1f1a66 Cr-Commit-Position: refs/heads/master@{#408239}

Patch Set 1 #

Patch Set 2 : Rebased #

Patch Set 3 : Fix the failing test on ASAN bots #

Total comments: 4

Patch Set 4 : Addressing creis@'s comments #

Patch Set 5 : Rebased #

Patch Set 6 : Fixed a typo in comment #

Total comments: 2

Patch Set 7 : Addressing kenrb@'s comments #

Total comments: 1

Patch Set 8 : Fix crashes due to pure virtual calls #

Patch Set 9 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -3 lines) Patch
M chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc View 1 2 3 4 5 6 7 8 2 chunks +80 lines, -0 lines 0 comments Download
M content/browser/renderer_host/text_input_manager.cc View 1 2 3 4 5 6 7 8 1 chunk +31 lines, -3 lines 0 comments Download

Messages

Total messages: 43 (27 generated)
EhsanK
Ken, Charlie: PTAL.
4 years, 5 months ago (2016-07-21 19:57:48 UTC) #8
Charlie Reis
Seems reasonable if Ken's happy with it. A few nits below. https://codereview.chromium.org/2171443003/diff/40001/content/browser/renderer_host/text_input_manager.cc File content/browser/renderer_host/text_input_manager.cc (right): ...
4 years, 5 months ago (2016-07-21 23:48:18 UTC) #9
EhsanK
Thanks for the reviews. PTAL. https://codereview.chromium.org/2171443003/diff/40001/content/browser/renderer_host/text_input_manager.cc File content/browser/renderer_host/text_input_manager.cc (right): https://codereview.chromium.org/2171443003/diff/40001/content/browser/renderer_host/text_input_manager.cc#newcode87 content/browser/renderer_host/text_input_manager.cc:87: // |active_view_| is only ...
4 years, 5 months ago (2016-07-25 21:09:57 UTC) #10
kenrb
It's not exactly ideal to add browser-side assumptions about Blink's IME implementation, but given the ...
4 years, 4 months ago (2016-07-26 20:40:38 UTC) #11
EhsanK
Thanks for the reviews! I will file a bug for the race condition for TextInputState ...
4 years, 4 months ago (2016-07-26 21:27:56 UTC) #12
EhsanK
On 2016/07/26 21:27:56, EhsanK wrote: > Thanks for the reviews! > > I will file ...
4 years, 4 months ago (2016-07-26 23:13:25 UTC) #13
Charlie Reis
LGTM.
4 years, 4 months ago (2016-07-26 23:52:11 UTC) #14
EhsanK
Thank you Charlie for the review/LGTM.
4 years, 4 months ago (2016-07-26 23:54:14 UTC) #17
EhsanK
PTAL. I think we should be fine now. Waiting for dry-run results. https://codereview.chromium.org/2171443003/diff/120001/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc ...
4 years, 4 months ago (2016-07-27 16:17:44 UTC) #22
Charlie Reis
Yeah, this is a bit awkward but I don't see a better way to handle ...
4 years, 4 months ago (2016-07-27 18:39:55 UTC) #25
EhsanK
On 2016/07/27 18:39:55, Charlie Reis wrote: > Yeah, this is a bit awkward but I ...
4 years, 4 months ago (2016-07-27 18:43:05 UTC) #26
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/2171443003/140001
4 years, 4 months ago (2016-07-27 18:43:27 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/226304)
4 years, 4 months ago (2016-07-27 18:48:41 UTC) #33
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/2171443003/160001
4 years, 4 months ago (2016-07-27 20:53:12 UTC) #39
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 4 months ago (2016-07-27 21:17:47 UTC) #41
commit-bot: I haz the power
4 years, 4 months ago (2016-07-27 21:19:10 UTC) #43
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/44c242985f1c9f81dc56e7d5122776250b1f1a66
Cr-Commit-Position: refs/heads/master@{#408239}

Powered by Google App Engine
This is Rietveld 408576698