Clean cherry-pick: Handle deleting non-single-word characters at end of input.

BUG:17587083

Original description:

Handle deleting non-single-word characters at end of input.  This includes both multi-word code-points and compositions of multiple single-word code-points.

A "backspace" from Android IME will send 1,0 as parameters to extendSelectionAndDelete(...) but it's possible that the last character of the input is a multi-word code and take multiple positions.

The setSelectedRange() call made by setSelectionOffsets() will _reduce_ the range to include only full characters and can end up reducing the range all the way to zero and causing the deleteSelection() call to do nothing.

BUG=355995
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176961

Change-Id: Iedb4b749551fcd037269eac989e3c97d242b3eb9
3 files changed