Calling InputMethodController::CommitText() with empty text fires beforeinput and textInput events, but not input |
|
Issue descriptionSee https://chromium-review.googlesource.com/c/chromium/src/+/834885/4/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html#181 Calling InputMethodController::CommitText() with empty text and no composition open doesn't change the text at all. Currently we fire beforeinput and textInput event, but don't fire input. We should either also fire the input event, or not fire any of these.
,
Jan 12 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/308f9ad3c2a3c91523c5efbbd426a533646d9d5c commit 308f9ad3c2a3c91523c5efbbd426a533646d9d5c Author: Ryan Landay <rlanday@chromium.org> Date: Fri Jan 12 21:08:58 2018 Don't fire beforeinput and textInput events for no-op CommitText() Currently, if an IME calls InputMethodController::CommitText() with no composition open and passes an empty string, we fire the beforeinput and textInput events (but *not* the input event). For consistency, it seems that we should not fire any events in this case, since the edit operation doesn't actually do anything. Note: it *is* theoretically possible for an IME to use CommitText() with an empty string just to move the selection. I'm not sure if this ever happens in practice or not. Bug: 796691 Change-Id: Ic13acc6842e92910e9c5ce7842f8f7b908fdec42 Reviewed-on: https://chromium-review.googlesource.com/862517 Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Ryan Landay <rlanday@chromium.org> Cr-Commit-Position: refs/heads/master@{#529067} [modify] https://crrev.com/308f9ad3c2a3c91523c5efbbd426a533646d9d5c/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-ime.html [modify] https://crrev.com/308f9ad3c2a3c91523c5efbbd426a533646d9d5c/third_party/WebKit/Source/core/editing/ime/InputMethodController.cpp [modify] https://crrev.com/308f9ad3c2a3c91523c5efbbd426a533646d9d5c/third_party/WebKit/Source/core/editing/ime/InputMethodControllerTest.cpp |
|
►
Sign in to add a comment |
|
Comment 1 by rlanday@chromium.org
, Jan 12 2018Status: Fixed (was: Assigned)