ime: Fix SetCompositionRange(before, after) to have correct default span
When calling SetCompositionRange(before, after) without custom underline behaviour, we create a default underline across the new composition range. Unfortunately, there is a mistake in the calculation when there is selected text. Although the before/after values correctly takes into account text selection, the default span doesn't, which causes incorrect underlining. The current code for creating the default span is in the extensions bindings, but that part of the code doesn't have access to the text selection. So move the default span logic to InputMethodChromeOS, where we have access to the text selection. Bug: b/174631364, b/168070907 Test: Add unit test for InputMethodChromeOS. Change-Id: I5726c8b106904988051079264b4638afcb43f69b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2626612Reviewed-by:Keith Lee <keithlee@chromium.org> Commit-Queue: Darren Shen <shend@chromium.org> Cr-Commit-Position: refs/heads/master@{#844414}
Showing
Please register or sign in to comment