|
|
DescriptionFix the bug that matras are input twice for Indian languages.
When we input an Indian matra after English letters, we will get 2 matras.
When we call InputMethodController::confirmComposition(), we will call
VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will
adjust the selection for grapheme boundary. In this case, the adjustment is wrong.
As a workaround, we can change InputMethodController::confirmComposition()
to call TypingCommand::insertText(), because insertText() doesn’t
adjust selection for grapheme boundary. Since insertText() doesn't dispatch
TextInputEvent, we should add it because it's needed for confirmComposition().
Note that cancelComposition() and confirmComposition() share the same tag
"TextCompositionConfirm". We only want to change the behavior of
confirmComposition(), and keep cancelComposition() unchanged, so we introduce
TextCompositionType::TextCompositionCancel for cancelComposition()
BUG=620690
Patch Set 1 #
Total comments: 3
Messages
Total messages: 20 (15 generated)
yabinh@chromium.org changed reviewers: + aelias@chromium.org, changwan@chromium.org
changwan@, can you take a look at this cl?
Description was changed from ========== Fix the bug that matras are added twice for Indian languages. If we call: commitText("a", 1); setComposingText("\u0C03", 1); finishComposingText(); Then we get “a\u0C03\u0C03” instead of “a\u0C03”. The matra is added twice. This is because it is not a grapheme boundary between “a” and “u0C03” according to Unicode GB9a. See http://www.unicode.org/reports/tr29/#GB9a There are 2 main steps in finishComposingText(): 1. Select the composing text, which is "\u0C03", and delete it. 2. Insert the composing text. At the very beginning, the selection is [1,2]. Then it is adjusted to [2, 2] for grapheme boundary. Since “u0C03” is not selected, it won’t be deleted. At last, we get 2 “u0C03”. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. BUG=620690 ========== to ========== Fix the bug that matras are added twice for Indian languages. If we call: commitText("a", 1); setComposingText("\u0C03", 1); finishComposingText(); Then we get “a\u0C03\u0C03” instead of “a\u0C03”. The matra is added twice. This is because it is not a grapheme boundary between “a” and “u0C03” according to Unicode GB9a. See http://www.unicode.org/reports/tr29/#GB9a There are 2 main steps in finishComposingText(): 1. Select the composing text, which is "\u0C03", and delete it. 2. Insert the composing text. At the very beginning, the selection is [1,2]. Then it is adjusted to [2, 2] for grapheme boundary. Since “u0C03” is not selected, it won’t be deleted. At last, we get 2 “u0C03”. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. BUG=620690 ==========
yabinh@chromium.org changed reviewers: + yosin@chromium.org
It seems description and changes aren't matched. Could you update description? https://codereview.chromium.org/2143883002/diff/1/content/public/android/java... File content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java (right): https://codereview.chromium.org/2143883002/diff/1/content/public/android/java... content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java:127: @CommandLineFlags.Add("enable-features=ImeThread") Could you write test in InputMethodControllerTest.cpp? We can verify this in unit test rather than integration test. https://codereview.chromium.org/2143883002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/commands/TypingCommand.h (right): https://codereview.chromium.org/2143883002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/commands/TypingCommand.h:49: TextCompositionCancel Could you move |TextCompositionCancel| related changes into another CL?
On 2016/07/13 07:56:07, Yosi_UTC9 wrote: > It seems description and changes aren't matched. > Could you update description? Did you mean the second paragraph from the end?
On 2016/07/13 at 08:06:02, yabinh wrote: > On 2016/07/13 07:56:07, Yosi_UTC9 wrote: > > It seems description and changes aren't matched. > > Could you update description? > > Did you mean the second paragraph from the end? I mean whole description and summary. Summary should explain changes in this patch. "Fix something" is the result of this patch instead of what patch does. And description is details of changes rather than description of issue. It is OK to have details of bug if it helps to explain changes.
Patchset #2 (id:20001) has been deleted
Description was changed from ========== Fix the bug that matras are added twice for Indian languages. If we call: commitText("a", 1); setComposingText("\u0C03", 1); finishComposingText(); Then we get “a\u0C03\u0C03” instead of “a\u0C03”. The matra is added twice. This is because it is not a grapheme boundary between “a” and “u0C03” according to Unicode GB9a. See http://www.unicode.org/reports/tr29/#GB9a There are 2 main steps in finishComposingText(): 1. Select the composing text, which is "\u0C03", and delete it. 2. Insert the composing text. At the very beginning, the selection is [1,2]. Then it is adjusted to [2, 2] for grapheme boundary. Since “u0C03” is not selected, it won’t be deleted. At last, we get 2 “u0C03”. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. BUG=620690 ========== to ========== Fix the bug that matras are inputted twice for Indian languages. When we input an English letter and an India matra,we will get 2 matras. This is because it is not treated as a grapheme boundary between the English letter and the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are inputted twice for Indian languages. When we input an English letter and an India matra,we will get 2 matras. This is because it is not treated as a grapheme boundary between the English letter and the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an English letter and an India matra, we will get 2 matras. This is because it is not treated as a grapheme boundary between the English letter and the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an English letter and an India matra, we will get 2 matras. This is because it is not treated as a grapheme boundary between the English letter and the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an India matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an India matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an India matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an India matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an India matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an India matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that we don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. This is because it is not treated as a grapheme boundary before the matra according to Unicode GB9a. For more details, see the description of this bug. As a workaround, we can change InputMethodController::insertTextDuringCompositionWithEvents() to call TypingCommand::insertText() instead of frame.eventHandler().handleTextInputEvent(), because the former doesn’t adjust selection for grapheme boundary. Note that we don't need to change the behavior of InputMethodController::cancelComposition(). BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. When we call InputMethodController::confirmComposition, we will call VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will adjust the selection for grapheme boundary. In this case, the adjustment is wrong. As a workaround, we can change InputMethodController::confirmComposition() to call TypingCommand::insertText(), because insertText() doesn’t adjust selection for grapheme boundary. Since insertText() doesn't dispatch TextInputEvent, we should add it because it's needed for confirmComposition(). Note that cancelComposition() and confirmComposition() share the same tag "TextCompositionConfirm". We only want to change the behavior of confirmComposition(), and keep cancelComposition() unchanged, so we need to split 1 tag into 2 tags. BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. When we call InputMethodController::confirmComposition, we will call VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will adjust the selection for grapheme boundary. In this case, the adjustment is wrong. As a workaround, we can change InputMethodController::confirmComposition() to call TypingCommand::insertText(), because insertText() doesn’t adjust selection for grapheme boundary. Since insertText() doesn't dispatch TextInputEvent, we should add it because it's needed for confirmComposition(). Note that cancelComposition() and confirmComposition() share the same tag "TextCompositionConfirm". We only want to change the behavior of confirmComposition(), and keep cancelComposition() unchanged, so we need to split 1 tag into 2 tags. BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. When we call InputMethodController::confirmComposition(), we will call VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will adjust the selection for grapheme boundary. In this case, the adjustment is wrong. As a workaround, we can change InputMethodController::confirmComposition() to call TypingCommand::insertText(), because insertText() doesn’t adjust selection for grapheme boundary. Since insertText() doesn't dispatch TextInputEvent, we should add it because it's needed for confirmComposition(). Note that cancelComposition() and confirmComposition() share the same tag "TextCompositionConfirm". We only want to change the behavior of confirmComposition(), and keep cancelComposition() unchanged, so we need to split 1 tag into 2 tags. BUG=620690 ==========
https://codereview.chromium.org/2143883002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/2143883002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/InputMethodController.cpp:277: insertTextDuringCompositionWithEvents(frame(), emptyString(), 0, TypingCommand::TextCompositionType::TextCompositionCancel); any chance that we incorrectly adjust selection for composition cancel? do we still need to fix something?
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. When we call InputMethodController::confirmComposition(), we will call VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will adjust the selection for grapheme boundary. In this case, the adjustment is wrong. As a workaround, we can change InputMethodController::confirmComposition() to call TypingCommand::insertText(), because insertText() doesn’t adjust selection for grapheme boundary. Since insertText() doesn't dispatch TextInputEvent, we should add it because it's needed for confirmComposition(). Note that cancelComposition() and confirmComposition() share the same tag "TextCompositionConfirm". We only want to change the behavior of confirmComposition(), and keep cancelComposition() unchanged, so we need to split 1 tag into 2 tags. BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. When we call InputMethodController::confirmComposition(), we will call VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will adjust the selection for grapheme boundary. In this case, the adjustment is wrong. As a workaround, we can change InputMethodController::confirmComposition() to call TypingCommand::insertText(), because insertText() doesn’t adjust selection for grapheme boundary. Since insertText() doesn't dispatch TextInputEvent, we should add it because it's needed for confirmComposition(). Note that cancelComposition() and confirmComposition() share the same tag "TextCompositionConfirm". We only want to change the behavior of confirmComposition(), and keep cancelComposition() unchanged, so we introduce TextCompositionType::TextCompositionCancel for cancelComposition() BUG=620690 ==========
Description was changed from ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. When we call InputMethodController::confirmComposition(), we will call VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will adjust the selection for grapheme boundary. In this case, the adjustment is wrong. As a workaround, we can change InputMethodController::confirmComposition() to call TypingCommand::insertText(), because insertText() doesn’t adjust selection for grapheme boundary. Since insertText() doesn't dispatch TextInputEvent, we should add it because it's needed for confirmComposition(). Note that cancelComposition() and confirmComposition() share the same tag "TextCompositionConfirm". We only want to change the behavior of confirmComposition(), and keep cancelComposition() unchanged, so we introduce TextCompositionType::TextCompositionCancel for cancelComposition() BUG=620690 ========== to ========== Fix the bug that matras are input twice for Indian languages. When we input an Indian matra after English letters, we will get 2 matras. When we call InputMethodController::confirmComposition(), we will call VisibleSelectionTemplate<Strategy>::updateIfNeeded(). The latter will adjust the selection for grapheme boundary. In this case, the adjustment is wrong. As a workaround, we can change InputMethodController::confirmComposition() to call TypingCommand::insertText(), because insertText() doesn’t adjust selection for grapheme boundary. Since insertText() doesn't dispatch TextInputEvent, we should add it because it's needed for confirmComposition(). Note that cancelComposition() and confirmComposition() share the same tag "TextCompositionConfirm". We only want to change the behavior of confirmComposition(), and keep cancelComposition() unchanged, so we introduce TextCompositionType::TextCompositionCancel for cancelComposition() BUG=620690 ========== |