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

Issue 790801 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Odd behavior with voice input suggestions when speaking "new paragraph"

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

Issue description

Chrome Version: 64.0.3282.0 (Developer Build) unknown (32-bit)
OS: Android 8.0.0

What steps will reproduce the problem?
(1) Make sure Gboard is installed.
(2) Go to editpad.org and tap in the text area.
(3) Use Gboard's voice input and dictate something like "hello new paragraph hello new paragraph hello".
(4) Tap on a grey underlined word and apply a suggestion. 

What is the expected result?

The suggestion should be applied properly.

What happens instead?

The suggestion inserts duplicate text because the suggestions span multiple paragraphs, but applying the suggestion only removes the existing text in the current paragraph.

The root cause of the issue is that DocumentMarkers cannot span multiple DOM nodes, so they get split up in this case.


Note: this bug was exposed by the fix I'm working on for  crbug.com/784039 .
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 6 2017

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

commit 1d58bc4000135f40585ea9aea8716a46aab05381
Author: Ryan Landay <rlanday@chromium.org>
Date: Wed Dec 06 03:31:36 2017

Make InputMethodController::SetComposition() set composition range from UndoStep

TypingCommand::InsertText(const String&, bool, EditingState*) is sort of messed
up right now because it calls AdjustSelectionAfterIncrementalInsertion(), which
calls FrameSelection::SetSelection(), which we want to hoist out of here (see
discussion at https://goo.gl/GFgLF3).

This CL removes AdjustSelectionAfterIncrementalInsertion's call to
SetSelection() and replaces it with some logic in
InputMethodController::SetComposition() to pull the ending selection out of the
most recent UndoStep. This sets us up to avoid an unnecessary selectionchange
event. Currently, SetComposition() does the following:

1. Selects the composition range.
2. Replaces the selection with the new text (requesting that the new text be
   left selected).
3. Converts the selection back into a composition range.

This CL sets us up to avoid actually selecting the range in step 2; instead, we
can make TypingCommand::InsertText() set it as the ending selection, and
InputMethodController can retrieve it from the UndoStep.

Bug: 790801
Change-Id: I9111af255f61c34f5bdaf27b94a5e8a659750860
Reviewed-on: https://chromium-review.googlesource.com/807151
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: yosin (OOO Dec 11 to Jan 8) <yosin@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521984}
[modify] https://crrev.com/1d58bc4000135f40585ea9aea8716a46aab05381/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
[modify] https://crrev.com/1d58bc4000135f40585ea9aea8716a46aab05381/third_party/WebKit/Source/core/editing/ime/InputMethodController.cpp

Comment 2 Deleted

Status: Assigned (was: Fixed)
Cc: rlanday@chromium.org
Labels: OS-Android
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment