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

Issue 796695 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Calling InputMethodController::FinishComposingText(kDoNotKeepSelection) with text that's too long for a form field fires compositionend twice

Project Member Reported by rlanday@chromium.org, Dec 20 2017

Issue description

See https://chromium-review.googlesource.com/c/chromium/src/+/834885/4/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html#249

Firing InputMethodController::FinishComposingText(kDoNotKeepSelection) with text won't entirely fit in a form field (e.g. because it exceeds an <input> element's maxlength attribute) fires compositionend twice. We should only fire compositionend once.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 17 2018

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

commit 500c8d1d245355c5b982b00d13d6747965f51cd8
Author: Ryan Landay <rlanday@chromium.org>
Date: Wed Jan 17 06:51:04 2018

Perform IME selection update before firing input and compositionend events

We've received numerous bug reports from web developers trying to use
JavaScript input event handlers to change the caret position after text is
entered that this does not work properly on Chrome for Android. The problem is
that the IME supplies a selection offset to move the cursor, which we currently
apply *after* running the input event handler. This CL fixes this problem by
using ScopedEventQueue to suppress input events from being fired until after we
apply the IME selection offset(s).

This CL also makes the same change for compositionend events (I haven't seen
the issue come up in practice for these events, since they're used much less
frequently, but it currently has the exact same issue).

Design doc for this CL with more information: https://goo.gl/xdy83L

Bug:  737395 ,  796695 
Change-Id: I0b5c3402b41ac5e11dbf1e74462045e99ba1d9c2
Reviewed-on: https://chromium-review.googlesource.com/838280
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529654}
[modify] https://crrev.com/500c8d1d245355c5b982b00d13d6747965f51cd8/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html
[modify] https://crrev.com/500c8d1d245355c5b982b00d13d6747965f51cd8/third_party/WebKit/Source/core/editing/ime/InputMethodController.cpp
[modify] https://crrev.com/500c8d1d245355c5b982b00d13d6747965f51cd8/third_party/WebKit/Source/core/editing/ime/InputMethodControllerTest.cpp

Labels: M-65
Status: Fixed (was: Assigned)

Sign in to add a comment